tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] X(X(1)) (nested macro substitution)


From: Sergey Korshunoff
Subject: [Tinycc-devel] X(X(1)) (nested macro substitution)
Date: Tue, 26 Apr 2016 13:32:23 +0300

About
#define Y(x) Z(x)
#define X Y
X(X(1))

If comment out in tccpp.c the following lines
/* if nested substitution, do nothing */
if ( (!s->next)
    && sym_find2(*nested_list, t))
{
    /* and mark it as TOK_NOSUBST, so it doesn't get subst'd again */
    tok_str_add2(tok_str, TOK_NOSUBST, NULL);
    goto no_subst;
}
then we get the right result  Z(Z(1) (but tcc loops in other macro
substiturion cases).
Currently we get Z(Y(1)), i.e. Y() is added to the nosubst_list affter
first substitution.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]