#elsif

Paul Eggert eggert@twinsun.com
Wed Apr 8 23:35:00 GMT 1998


   Date: Wed, 8 Apr 1998 10:16:11 -0400 (EDT)
   From: Gavin Romig-Koch <gavin@cygnus.com>

   The syntax of preprocessing directives are clearly spelled out,

Yes; here's the definition in the standard.

	A preprocessing directive consists of a sequence of
	preprocessing tokens that begins with a `#' preprocessing
	token that is either the first character in the source file
	(optionally after white space containing no new-line
	characters) or that follows white space containing at least
	one new-line character, and is ended by the next new-line
	character.

Draft C9x changes this wording slightly, but the change doesn't matter
for our purposes.

   and "#elsif" does not fit.

I don't see why not.  `#elsif' is a sequence of preprocessing tokens,
all alone in a line; this fits the definition quoted above.


   From: Joern Rennecke <amylaar@cygnus.co.uk<>
   Date: Wed, 8 Apr 1998 15:08:47 +0100 (BST)

   wthe standard allows any number of warnings, no matter how bogus
   they are.  So why not always warn about #elsif

I assume that you do not want to make a special case for `elsif' only.
(That would be odd; it wouldn't catch other misspellings like `elseif'.)
But if we report _all_ misspelled directives, then we run afoul of the
examples that caused RMS to change cccp.c to behave the way it does
today.

I wouldn't mind adding the checking to -W (or perhaps to -Wundef); but
I don't think it should be on by default.



More information about the Gcc mailing list