[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libintl.h warnings with -Wundef
From: |
Bruno Haible |
Subject: |
Re: libintl.h warnings with -Wundef |
Date: |
Fri, 19 Sep 2008 03:08:28 +0200 |
User-agent: |
KMail/1.5.4 |
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.
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".
Bruno
Re: libintl.h warnings with -Wundef, Ralf Wildenhues, 2008/09/20