From: Brian P. <br...@va...> - 2001-06-15 15:23:45
|
Josh Vanderhoof wrote: > > Here's a patch that fixes some type alias bugs that show up with > -fstrict-aliasing on gcc (which will be the default for gcc 3.0). For > the most part the patch just changes instances of > > *(xtype *)&y > > which could possibly read from the address &y before the value of y > has been written out to memory due to C aliasing rules, with > > ((union { xtype xt; ytype yt;} *)&y)->xt > > which is safe for gcc since the created pointer can alias both xtype > and ytype. Hopefully other compilers will also assume union pointers > can alias all of their member types. I've applied the patch. I put the typedef for fi_type in glheader.h so it can be easily used anywhere. -Brian |