[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] C99 token pasting
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] C99 token pasting |
Date: |
Sat, 12 Apr 2014 19:23:26 +0800 |
User-agent: |
K-9 Mail for Android |
Hi Jay,
On April 1, 2014 5:22:55 PM GMT+08:00, Jay Foad <address@hidden> wrote:
> 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 ++.
Fixed in mob.
Cheers,
Thomas