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

Re: libc6-dev and "-pedantic -O" warnings



At 12:22 AM 6/6/99 -0500, Manoj Srivastava wrote:
>Hi,
>>>"Chris" == Chris Waters <xtifr@dsp.net> writes:
>
> Chris> Kirk Hilliard <kirk@ghoti.com> writes:
> >> $ gcc -pedantic -O toupper.c
> >> toupper.c: In function `main':
> >> toupper.c:5: warning: ANSI C forbids braced-groups within expressions
> >> $
>
> >> Is this a bug, or can we no longer expect well written code to compile
> >> warning free when optimizing?
>
> Chris> The libraries (and in particular, the headers) use non-ANSI-C
> Chris> features that are supported by gcc,
>
>        In other words, we have a non conforming system, then? 

In theory, the non-ANSI features are only turned on when compiling under
GNU C. (In practice, GLibc only builds on systems that primarily use GCC,
so no one usually tries it under other compilers.)
If you want to turn them off, you could probably undefine _GNUC,
_GNUC_MINOR and _GNUC_MAJOR (I believe those are the names), which may
work, but may have unpredicatable results and will definetly decrease
efficency. IMHO, it really doesn't matter that the libc headers have GNU C
specific features, as they were only designed to be used with it. It might
help to have it not warn, though. I'll mention it on the EGCS list.

> Chris> if possible, but if you then use -pedantic, you'll get
> Chris> warnings about these features from the compiler.  The
>
>        I would hope so. Why would one wish to promote non-standard
> code? 

In other news, Linus Torvalds participates in another argument/flamewar on
the EGCS list about unspecified behavior that EGCS changed and broke Linux.

>        Au contraire. You really have not tried to code portably, have
> you? This is what I use for my production code:

Ouch. Do you still worry about K&R C systems too?
>
>        manoj
>
--
David Starner - dstarner98@aasaa.ofe.org (alternately dvdeug@hotmail.com)
If you wish to strive for peace of soul, then believe; if you wish to be a
devotee of truth, then inquire. -- Friedrich Nietzsche


Reply to: