public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Stoehr <netbsd@wolfnode.de>
To: gcc-help@gcc.gnu.org
Subject: CPP preprocessor: #define-splitting?
Date: Thu, 26 Aug 2004 06:46:00 -0000	[thread overview]
Message-ID: <Pine.NEB.4.58.0408252358270.250@irina.net.flo> (raw)

Hi,

I'm developing a gcc-compatible preprocessor for a compiler project. While
doing this, I discovered something strange.

In preprocessor documentation:

    /\
     *
     */ # /*
     */ defi\
     ne FO\
     O 10\
     20


will expand to "#define FOO 1020". It does.

But:

# /*
*/ define TEST "foo"

--> #define TEST "foo"

Replacing the "#" by an "X" will produce with gcc -E:

X
 define TEST "foo"


_BUT_:
#
 define TEST "foo"

--> TEST doen't get defined.

The problem is: Why does it recognize the "#" and "define" splitted by a
multi-line comment as "#define"? Is this the correct behaviour?

Thanks for your help
Florian

             reply	other threads:[~2004-08-25 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-26  6:46 Florian Stoehr [this message]
2004-08-26  7:13 ` Eljay Love-Jensen
2004-08-26 12:10   ` Florian Stoehr

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=Pine.NEB.4.58.0408252358270.250@irina.net.flo \
    --to=netbsd@wolfnode.de \
    --cc=gcc-help@gcc.gnu.org \
    /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).