[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH] Preprocessor: ignore everything after #error

From: Marc Andre Tanner
Subject: Re: [Tinycc-devel] [PATCH] Preprocessor: ignore everything after #error or #warning
Date: Tue, 25 Sep 2007 12:21:35 +0200
User-agent: Thunderbird (Windows/20070728)

Dave Dodge wrote:

You're right.  I missed that caveat about single quotes being
undefined.  I'd mainly looked at the grammar in Annex A, which simply
says "each non-white-space character that cannot be one of the above"
and doesn't bother to mention quotes as a special case.

So the _real_ problem is that the C code you're processing has
undefined behavior ;-)

Ok, but it is not my code, i just want to compile it. And since it works with gcc...

You could argue that since the line in question is #ifdef'd out, the
token shouldn't be a problem.  But going strictly by the Standard you
get the undefined behavior as early as translation phase 3 when the
tokenization takes place, and the #ifdef doesn't get handled until
phase 4.

I argue that gcc ignores it so we can too.

Note that the bare apostrophe probably also wreaks havoc with syntax
highlighting editors.  Emacs 21.4 seems to get very confused by it.

Vim seems to handle it just fine.


 Marc Andre Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0

reply via email to

[Prev in Thread] Current Thread [Next in Thread]