public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* #elsif
@ 1998-04-07  6:54 Philippe De Muyter
  1998-04-07 19:34 ` #elsif Paul Eggert
       [not found] ` <199804080118.SAA26855.cygnus.egcs@shade.twinsun.com>
  0 siblings, 2 replies; 13+ messages in thread
From: Philippe De Muyter @ 1998-04-07  6:54 UTC (permalink / raw)
  To: gcc mailing list, egcs mailing list

The following program compiles without a warning with gcc -W -Wall,
but does not do what the programmer expected.

With the native cc, I get :

	**Error: /tmp/elsif.c: 8: undefined control

-----------------------------------------------------------------------
#include        "stdio.h"
#define B

int main()
        {
#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
	return 0;
        }

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: #elsif
@ 1998-04-08  2:13 SXTHREE
  0 siblings, 0 replies; 13+ messages in thread
From: SXTHREE @ 1998-04-08  2:13 UTC (permalink / raw)
  To: phdm; +Cc: egcs

I do not think elsif is a standard preprocessor directive.
C++ standards say the correct directive is "elif".
(Or maybe I missed some versions of the standard).
Seems strange gcc accepts this construct without warnings.

FM

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~1998-04-09 17:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-04-07  6:54 #elsif Philippe De Muyter
1998-04-07 19:34 ` #elsif Paul Eggert
1998-04-08  9:27   ` #elsif Joern Rennecke
1998-04-08 15:08   ` #elsif Gavin Romig-Koch
1998-04-08 23:35     ` #elsif Paul Eggert
1998-04-08 21:20       ` #elsif Philippe De Muyter
1998-04-08 21:13         ` #elsif Paul Eggert
1998-04-09  8:27           ` #elsif Joe Buck
1998-04-09  3:09         ` #elsif Nick Ing-Simmons
1998-04-08 21:45       ` #elsif Gavin Romig-Koch
1998-04-09 17:44       ` #elsif Joern Rennecke
     [not found] ` <199804080118.SAA26855.cygnus.egcs@shade.twinsun.com>
1998-04-08 15:08   ` #elsif Ulrich Drepper
1998-04-08  2:13 #elsif SXTHREE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).