[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] C99 token pasting
From: |
Jay Foad |
Subject: |
[Tinycc-devel] C99 token pasting |
Date: |
Tue, 1 Apr 2014 10:22:55 +0100 |
C99 specifies the behaviour of token pasting when either (or both) of
the arguments to be pasted expand to an empty sequence of tokens. tcc
doesn't seem to implement this:
$ cat p.c
#define P(A,B) A ## B bob
#define Q(A,B) A ## B+
P(jim,)
Q(+,)
$ ./tcc -E p.c
# 2 "p.c"
p.c:3: warning: pasting "jim" and " " does not give a valid preprocessing token
jim bob
++
In the P() example, the warning is inappropriate.
In the Q() example, the result is wrong. We should get + and + as two
separate tokens, not the single token ++.
Jay.
- [Tinycc-devel] C99 token pasting,
Jay Foad <=