[Fwd: w32api and gcc -pedantic]]
Mon Apr 16 07:26:00 GMT 2001
Monday, 16 April, 2001 Earnie Boyd email@example.com wrote:
EB> Unless someone can give me a reasonable counter to Danny's reply below,
EB> I'm not accepting this patch.
EB> -------- Original Message --------
EB> Subject: Re: [MinGW-dvlpr] [Fwd: w32api and gcc -pedantic]
EB> Date: Sat, 14 Apr 2001 07:30:01 +1000 (EST)
EB> From: Danny Smith <firstname.lastname@example.org>
EB> Reply-To: email@example.com
EB> To: firstname.lastname@example.org
EB> --- Earnie Boyd <email@example.com> wrote: > What do others
EB> Danny) on this list think of this patch?
>> -------- Original Message --------
>> Subject: w32api and gcc -pedantic
>> Date: Fri, 13 Apr 2001 23:10:57 +0400
>> From: egor duda <firstname.lastname@example.org>
>> Reply-To: egor duda <email@example.com>
>> Organization: deo
>> To: firstname.lastname@example.org
>> w32api headers currently contain a number of anonymous structs and
>> unions. So, gcc prints a bunch of warnings when invoked with -pedantic
>> on program which #include <windows.h>. this patch is to avoid those
EB> My reading of C99 standard (section 126.96.36.199) is that nameless
EB> are now part of standard. The fix should go into GCC not the mingw
EB> GCC -pedantic -std=iso9899:199x should not raise warnings about unnamed
EB> structures; GCC -pedantic -std=iso9899:199409 should.
EB> I think the warnings should stay for now, since they are extensions to
EB> the currently supported standard.
Warnings should stay as long as we talk about user's code. But when it
comes to system header files, i believe (and my reading of various
existing standard headers make me believe so) that we should work
around such warnings. For example, many standard headers contain
fragments like this one:
#if defined(__STDC__) || defined(__cplusplus)
#define SIG_DFL ((void (*)(int))0)
#define SIG_IGN ((void (*)(int))1)
#define SIG_ERR ((void (*)(int))-1)
#define SIG_DFL ((void (*)())0)
#define SIG_IGN ((void (*)())1)
#define SIG_ERR ((void (*)())-1)
so, it doesn't matter if we use compiler (or compile-time switch for
compiler) that doesn't support some feature or fires a warning seeing
it -- standard headers will compile cleanly.
if running gcc with '-pedantic' define some macro that could be tested
in standard headers, we could use it. But, afaik, it doesn't define
anything like it. Instead, gcc info recommends marking such code fragments
explicitly as '__extension__'.
My point is: standard headers shouldn't produce warnings whether you
compile them with new version of compiler or old one. It should matter for
user's code not for standard headers.
Egor. mailto:email@example.com ICQ 5165414 FidoNet 2:5020/496.19
More information about the Cygwin-patches