In message: <20100614083424.gc16...@cs.hut.fi>
            Antti Kantee <po...@cs.hut.fi> writes:
: On Mon Jun 14 2010 at 07:00:05 +0000, David Holland wrote:
: > On Sun, Jun 13, 2010 at 03:17:02PM +0000, Antti Kantee wrote:
: >  > Fix previous in emul.c -- only numbers are operands for cpp comparisons.
: >  > Apparently non-numbers logically produce arch-dependent behaviour.
: > 
: > Not at all.
: > 
: > C99 6.10.1 #4:
: > 
: >   [...] After all replacements due to macro expansion and the defined
: >   unary operator have been performed, all remaining identifiers
: >   (including those lexically identical to keywords) are replaced with
: >   the pp-number 0, and then each preprocessing token is converted into
: >   a token. The resulting tokens compose the controlling constant
: >   expression which is evaluated according to the rules of 6.6. [...]
: 
: So, you being the person who attempted to write cpp with sed, what
: comparison does "amd64 == sun3" actually result in?  What about
: "i386 == sun3" (the former returned true, the latter didn't).

On i386, that's true.  amd64 expands to '0', as does sun3.  This makes
the first one true.  The second one, i386 expands to '1', so the
second one would be false.

Warner

Reply via email to