On Wed, 30 Aug 2000, Mathieu Chouquet-Stringer wrote:

> /usr/include/curses.h:360:9: warning: "GCC_PRINTF" is not defined
> /usr/include/curses.h:366:9: warning: "GCC_SCANF" is not defined

> thing... The difference is in the -Wundef flag given to the preprocessor
> (gcc -E). Without it, the results are the same between the two gcc. The
> strange thing, is that the gcc info page tells:
> `-Wundef'
>      Warn if an undefined identifier is evaluated in an `#if' directive.
> 
> In the curses.h, the test is:
> #if     GCC_PRINTF
> and GCC_PRINTF is not defined before. So gnu guru folks, did this option do
> anything under gcc 2.91??

-Wundef is fairly recent, but not _that_ recent iirc.  I don't use it
much, because only a very small fraction of the warnings reflect a
misspelling.  Some other compilers (Watcom) did this first, btw.

> And by the way why if instead of ifdef?

it's more readable (GCC_PRINTF would only be defined via autoconf,
so it would only be undefined, or 1 - in that case a #if works fine).

-- 
T.E.Dickey <[EMAIL PROTECTED]>
http://dickey.his.com
ftp://dickey.his.com

Reply via email to