[Tinycc-devel] macro substitution bug

2008-04-29 Thread Feng Nauh
see: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm

macro.c:

#define x 3
#define f(a) f(x * (a))
#undef x
#define x 2
#define g f
#define z z[0]
#define h g(~
#define m(a) a(w)
#define w 0,1
#define t(a) a
f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x+(3,4)-w) | h 5) & m
  (f)^m(m);

results in:
f(2 * (y+1)) + f(2 * (f(2 * (z[0] % f(2 * (0)) + t(1);
f(2 * (2+(3,4)-0,1)) | f(2 * (~ 5)) & f(2 * (0,1))^m(0,1);

but TCC -E  hangs and result as:
f ( 2 * ( y + 1 ) ) + f ( 2 * ( f ( 2 * ( z [ 0 ] [ 0 ] [ 0 ] ) ) ) ) % f (
2 *
( 0 ) ) + t ( 1 ) ;
f ( 2 * ( 2 + ( 3 , 4 ) - 0 , 1 ) ) | macro.c:12: memory full

PS: [EMAIL PROTECTED] post a macro substitution bug on 12/18/07, it do
not fix yet; there is a patch in Rob's mail-list.
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] macro substitution bug

2007-12-18 Thread ShangHongzhang 62185
given the following code, TCC can't expent it to correct result.

#define t_fwd_rnd(x) x
#define t_rnd(rm) t_fwd_rnd
#define round(rm, x) t_rnd(rm)(x);t_rnd(rm)(x);

void foo ()
{
int b0;
round(fwd_rnd,  b0);
}

the correct result should be: b0; b0
but the TCC give the result of:  b0 ; t_rnd ( fwd_rnd ) ( b0 ) ;
the second t_rnd was not expend successfully.


___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/tinycc-devel