tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] tcc failed to compile after preprocess


From: Changming Xu
Subject: Re: [Tinycc-devel] tcc failed to compile after preprocess
Date: Mon, 28 Feb 2011 11:53:59 +0800

 #define m(name,r)  name ## r
    #define m0(a,b,c) int m(a,b)   c
    #define m1(a,b,c) int m(a,b)c
    m0(a, b, c);
    m1(a, b, c);

if only
 spc = 0;

m1 failed, but i have no idea  if we should fix it in tcc, it's not that important
do we have better way?

another example:

#define CONC(a,b) a/**/b


to fix it, return ' ' when see a /**/comment(also c++ comment?) in  next_nomacro1 which

        /* comments or operator */
    case '/':
        PEEKC(c, p);
        if (c == '*') {
            p = parse_comment(p);
#if 1
        tok = ' ';
        goto keep_tok_flags;
#endif
            goto redo_no_start;



2011/2/28 grischka <address@hidden>
Changming Xu wrote:
hello, everyone

   Tcc can not compile the output of 'tcc -E' with the following case:
  #include <math.h>
int main()
{
}
  int my unubtu 10.04

Thanks, saw you fixed it:
 http://repo.or.cz/w/tinycc.git/commitdiff/185fba418978aabef36765fdfaf24d516f1a9f33

However would not adding just one line work as well, like:

            macro_ptr = ml.p;
            if (can_read_stream && *can_read_stream == &ml)
                *can_read_stream = ml.prev;
            if (ret != 0)
                goto no_subst;
+            spc = 0;
        } else {
        no_subst:
            if (!check_space(t, &spc))
                tok_str_add2(tok_str, t, &cval);
        }

--- grischka


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


reply via email to

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