[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Preprocessing behavior
From: |
Patrick Pelissier |
Subject: |
[Tinycc-devel] Preprocessing behavior |
Date: |
Wed, 12 Apr 2017 23:28:21 +0200 |
Hello,
I think I found a bug in the preprocessor of tcc.
The following program:
#define M_RETI_ARG27(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,aa,
...) aa
#define M_RET_ARG27(...) M_RETI_ARG27(__VA_ARGS__)
#define M_COMMA_P(...) M_RET_ARG27(__VA_ARGS__, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
useless)
#define M_EMPTYI_DETECT(...) 0, 1,
#define M_EMPTYI_P_C1(...) M_COMMA_P(M_EMPTYI_DETECT __VA_ARGS__ () )
M_EMPTYI_P_C1()
M_EMPTYI_P_C1(x)
produces the following output with the command "tcc -E"
0
0
instead of the expected output:
1
0
tested with tcc 536ed76d5a69d8e3c0e247d6557f5942818cb253
--
Regards,
Patrick PĂ©lissier
- [Tinycc-devel] Preprocessing behavior,
Patrick Pelissier <=