Re: Deferencing type-punned pointers, and how to stop gcc giving youa warning



On Tue, 2004-04-27 at 05:29, Chris Sherlock wrote:

> One last thing: half these warnings wouldn't happen if we knew what 
> standard we were compiling to: C89 or C99. 

C89.

> I asked on #gnome-hackers the 
> other night and I got two responses. jdub said it was undefined (lovely 
> word that) but then suggested we compile to C89 to try to keep max 
> compatibility. In which case the -ansi tag would be the go.

-ansi breaks a ton of stuff.  We want to be able to use GCC extensions
where available.  The best way in my opinion is to use -std=c89, along
with -Wall -Werror and a bunch of other -Wblah flags.  The rhythmbox
configure.ac has some code to do this that I shamelessly stole from Alex
Larsson's gnome-keyring code and hacked up.

>  Of course, 
> if we compile to C89, what features and advantages of C99 are we missing 
> out on?

Mixed declarations and code, and variable-length arrays are the big
ones, the latter of which is broken in GCC last I checked.

Attachment: signature.asc
Description: This is a digitally signed message part



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