[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#530949: gcc-4.4: warns about idiomatic use of Berkeley sockets



On Fri, May 29, 2009 at 11:35:28PM +0100, Philip Martin wrote:
> "brian m. carlson" <sandals@crustytoothpaste.ath.cx> writes:
> 
> > I expect that when used on a POSIX system (at least in strict POSIX mode
> > or when invoked as "c99"), gcc-4.4 neither warns nor generates code
> > contrary to POSIX with -O2 -Wall.
> 
> You can add -fno-strict-aliasing which will disable the optimisation
> and thus prevent the warning.  -O2 is documented to include
> -fstrict-aliasing which is the optimisation that causes the warning.

I'm aware of that.  My opinion remains the same: GCC should generate
POSIX-conformant code without warnings with -O2 -Wall.  That can be
achieved by disabling -fstrict-aliasing at -O2, by patching glibc to
allow aliasing of the relevant types, by special-casing these types on a
POSIX system, or by something else altogether.  How it is achieved is
mostly irrelevant to me, as long as it stops breaking code that is
explicitly documented by POSIX to work (and has worked for longer than
I've been alive).

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

Attachment: signature.asc
Description: Digital signature


Reply to: