This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: unwanted compiler warnings with -pedantic


On Wed, Oct 25, 2000 at 01:40:15PM -0400, Shayne Steele wrote:
>        Thank you for your response.
>
>        The problem is I WANT all those little annoying warnings for MY
>code just not for the COMPILER'S code.  I have found that code that
>produces no warnings when the '-Wall -pedantic' flags are used is VERY
>portable between different compilers and between different machine
>architectures.  
>        A compiler that complains about its own code seems weird.  In
>B20.1 this this problem did not occur, perhaps the compiler should be
>re-looked at in the net release.

I just looked at the compiler.  It was sitting in a corner not really
doing much of anything.  I poked it with a stick a couple of times and
it just flinched and huddled further into the corner.

I don't think the compiler wants to be bothered.

(Before I get email from people telling me that a compiler is not a
physical entity capable of being poked with a stick, I would like to
point out that the above was a crude attempt at humor.)

Anyway, we *can't* change things in the header because we're using
headers that are very similar to Microsoft's.  Their code is not ANSI C
compatible so ours isn't either.

Just as an exercise, try to come up with some way, in gcc, to represent
a 64 bit integer which does not use 'long long'.  That will get rid of
one of the warnings.

If you would like to submit patches to rectify the behavior, I'm sure
that the various newlib and w32api maintainers would consider applying
them.

cgf

>> > Well, the -pedantic switch turns on as many annoying warnings as
>> > possible; the word "pedantic" means overly attentive to rules,
>> > excessively "by the book."
>> > 
>> > That said, the info pages for gcc tell you how to turn off some
>> > specific warnings. For instance -Wno-long-long turns off the long long
>> > warning,
>> > 
>> > I think Shayne Steele wrote:
>> > >Hello
>> > >
>> > >        I recently upgraded from B20.1 to the net release 1.1.x.
>> > >My GCC compiler options include -Wall -pedantic.  My program use to
>> > >compile with no errors or warnings, but after the upgrade (and modifying
>> > >my makefile to point to the new locations of the libraries) I got a lot
>> > >of 'extra' warnings, such as:
>> > >
>> > >c:/cygwin/usr/include/mingw32/stdlib.h:349: warning: ANSI C does not
>> > >support `long long'
>> > >/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2/../../../../include/mmsystem.h:1195:
>> > >warning: ANSI C doesn't support unnamed structs/unions
>> > >usr/lib/gcc-lib/i686-pc-cygwin/2.95.2/../../../../include/winbase.h:814:
>> > >warning: ANSI C doesn't support unnamed structs/unions
>> > >/usr/lib/gcc-lib/i686-pc-cygwin/2.95.2/../../../../include/winnt.h:2269:
>> > >warning: ANSI C doesn't support unnamed structs/unions
>> > >
>> > >These warnings are annoying, how do I get rid of them?  I just want
>> > >warnings on the code I wrote.  I want to keep using the net release and
>> > >the -pedantic option (if at all possible).
>> > ---------------------------------------------------------
>> > Ernest Friedman-Hill  
>-- 
>Shayne Steele	    Graduate Student in Computer Science at FSU
>steele@cs.fsu.edu   http://www.cs.fsu.edu/~steele/
>With great abilities come great responsibilities. -- Stan Lee
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com

-- 
cgf@cygnus.com                        Red Hat, Inc.
http://sources.redhat.com/            http://www.redhat.com/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]