Thanks. I also went and made the compiler warn about it.

Places where "warning: dereferencing type-punned pointer will break
strict-aliasing rules [-Wstrict-aliasing]" occurs on gcc 4.6.0:

code/qcommon/net_ip.c
code/renderer/tr_backend.c
code/renderer/tr_shade.c
code/renderer/tr_shade_calc.c:
code/renderer/tr_surface.c:

On Wed, Jun 30, 2010 at 1:09 PM, Patrick Baggett
<baggett.patr...@gmail.com> wrote:
> Any time a float and int are used with aliased points, for short.
> e.g.
> int* x = (int*)&float_value;
> *x = 0x7F000000; //set to 1.0f or something
>
> union asdf {
> int x;
> float f;
> } var;
> var.f = 123.0f;
> var.x >>= 2; //aliasing issue.
>
> See C99 spec for what is/isn't legal. Check network and file code for
> problems.
_______________________________________________
ioquake3 mailing list
ioquake3@lists.ioquake.org
http://lists.ioquake.org/listinfo.cgi/ioquake3-ioquake.org
By sending this message I agree to love ioquake3 and libsdl.

Reply via email to