#elsif

Ulrich Drepper drepper@cygnus.com
Wed Apr 8 15:08:00 GMT 1998


eggert@twinsun.com (Paul Eggert) writes:

> 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.

The wording may not, but section 6.8 is very clear.  `control line'
mentions only a fixed amount of possibilities which start with # and
which are handled separately.  All other input is handled as
preprocessing-token and is in case of a not fulfilled #if condition to
be ignored.  The current behaviour is therefore ok.

This also means that #elsif never must be an error but warnings can be
issued if one wants.  But since some compiler manufacturers invent new
# directives it is questionable.  (Of course # directives shouldn't be
introduced but this is something different).

I therefore vote against changing the current behaviour or at least
make the warning not available in -Wall.

-- Uli
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------



More information about the Gcc mailing list