Subject: Re: C compiler flags
To: NetBSD/pkgsrc-users <pkgsrc-users@netbsd.org>
From: Roland Illig <rillig@NetBSD.org>
List: pkgsrc-users
Date: 11/16/2006 10:26:49
Christian Biere wrote:
> Blair Sadewitz wrote:
> 
>>I have seen packages before which do not use -O2, probably due to bugs
>>in the compiler.
> 
> 
> Probably? I doubt it. It is very likely a bug in the package.
> 
> 
>>Now, bugs are hopefully transient, but they do exist.  Actually, I
>>think some packages had problems like this on the alpha architecture,
>>for example.
> 
> 
> Yes, I've seen funky results from code ignoring alignment requirements
> which were clear and not very special bugs in the software, not the
> compiler. For GCC it's a good idea to add
> 
> CFLAGS += -Wall -Wformat=2 -Wshadow

Or even the flags mentionen on [1]. These settings always make me wonder 
that the software we are using daily works so good.

Roland

[1]http://wiki.netbsd.se/index.php/Examples_for_pkgsrc-specific_mk.conf_files