public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Gavin Romig-Koch <gavin@cygnus.com>
To: Paul Eggert <eggert@twinsun.com>
Cc: phdm@macqel.be, gcc2@cygnus.com, egcs@cygnus.com
Subject: Re: #elsif
Date: Wed, 08 Apr 1998 15:08:00 -0000	[thread overview]
Message-ID: <m0yMve7-0006vBC@cetus.cygnus.com> (raw)
In-Reply-To: <199804080118.SAA26855@shade.twinsun.com>

Paul Eggert writes:
 >    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.

I disagree.  While I agree that the standard could be clearer
about this, as I read it, a diagnostic must be issued for the
"elsif".

The syntax of preprocessing directives are clearly spelled out,
and "#elsif" does not fit.  The standard requires a diagnostic
if there is a syntax violation.

There is a passage in 3.8.1, in the context of explaining what
gets skipped by a false directive, "directives are processed
only through the name that determines the directive...".  In
this case the name is "elsif" which does not fit syntacticly.

If you read it differently Paul, show us what you see.

                                        -gavin...

  parent reply	other threads:[~1998-04-08 15:08 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Gavin Romig-Koch [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m0yMve7-0006vBC@cetus.cygnus.com \
    --to=gavin@cygnus.com \
    --cc=egcs@cygnus.com \
    --cc=eggert@twinsun.com \
    --cc=gcc2@cygnus.com \
    --cc=phdm@macqel.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).