This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: #elsif
- To: phdm at macqel dot be
- Subject: Re: #elsif
- From: Paul Eggert <eggert at twinsun dot com>
- Date: Tue, 7 Apr 1998 18:18:10 -0700
- CC: gcc2 at cygnus dot com, egcs at cygnus dot com
- References: <199804071008.MAA30001@mail.macqel.be>
Date: Tue, 7 Apr 1998 12:08:20 +0200 (MET DST)
From: "Philippe De Muyter" <phdm@macqel.be>
#if defined(A)
printf("A defined\n");
#elsif defined(B)
printf("B undefined\n");
#else /* nor A nor B */
printf("nor A nor B defined\n");
#endif
As I read the C standard, if A is not defined, then GCC is required to
accept that program fragment, though I admit the standard's wording is
not entirely clear.
It might be useful for cpp to warn about skipped, unknown directives
if -W or -Wall is specified.