bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: libintl.h warnings with -Wundef


From: Marc Espie
Subject: Re: libintl.h warnings with -Wundef
Date: Fri, 19 Sep 2008 20:11:48 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Fri, Sep 19, 2008 at 03:08:28AM +0200, Bruno Haible wrote:
> Christian Weisgerber wrote:
> > Projects that include libintl.h and build with gcc -Wundef show warnings
> > such as these:
> > 
> > /usr/local/include/libintl.h:91:25: warning: "__APPLE_CC__" is not defined
> > /usr/local/include/libintl.h:113:24: warning: "__APPLE_CC__" is not defined
> 
> This -Wundef option is pointless:
>   - Is its purpose to catch portability problems w.r.t. other compilers? No.
>     All C compilers at least since 1980 have evaluated undefined identifiers
>     in preprocessor expressions to 0.
>   - Is its purpose to detect typos? No, because you recommend to avoid the
>     warning by using the idiom   (defined X && X).  But when I have a typo
>     in X and use this idiom nevertheless, copy&pasting the identifier as 
> usual,
>     my code will still be wrong and no warning will be flagged.
> 
> So I don't see a reason to do particular efforts for the sake of this warning.

How about if we give you a correct patch for it ?

What effort do you have to make ?

Do you want to make me laugh and tell me maintaining if defined X && X will be 
hard ?

> Btw, you can get rid of the warning also by using the gcc command line
> option "-isystem /usr/local/include" instead of "-I /usr/local/include".

That's assuming there are only nice headers under /usr/local/include, which is
not at all the case in the case at hand...

Oh, libintl.h is "special". Should we create a specific directory just for it ?

The other possible question is, if it's a pointless warning, why is it still
possible to have it in gcc ?

Why do othe projects use it on various software ?

This is just a pain in the ass... compiling thousands of software projects is
not that easy. Each stupid warning is noise. Disabling those warnings means
tinkering with hundreds of makefiles, if you're lucky, or tinkering with
hundreds of autoconf/automake configurations, since we live on a planet where
bloated gasplants are the norm...

Adding -isystem here, disabling -Wundef there. Yes, this is possible, but
the path of least resistance is just to fix the warning.

I really don't see any downside to it. Prove to me otherwise.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]