Alexandre Becoulet wrote:
Current implementation relies on a single nested tokens list to prevent recursive expansion. It appears some bugs can not be fixed without storing some context for each expanded token.

Yeah, basically the macro expansion behavior is designed by the
interaction of these five macro_xxx_xxx functions, but I once came
to the conclusion that this (more or less implicit) design is
probably not really suited to produce correct behavior under any
circumstances.

That does not mean that it needs to be more complex necessarily,
but it seems that it needs to be different, somehow.  Looking
into other preprocessor implementations (gcc, pcc, lcc, ...) might
give some ideas.


While trying to feed tcc with output from the GNU preprocessor I fixed this trivial bug:


Please push patches on our "mob" branch ;)
  http://repo.or.cz/w/tinycc.git

Thanks,
--- grischka

--- a/tccpp.c
+++ b/tccpp.c
@@ -1620,7 +1620,7 @@ include_done:
         pragma_parse(s1);
         break;
     default:
-        if (tok == TOK_LINEFEED || tok == '!' || tok == TOK_CINT) {
+        if (tok == TOK_LINEFEED || tok == '!' || tok == TOK_PPNUM) {
             /* '!' is ignored to allow C scripts. numbers are ignored
                to emulate cpp behaviour */
         } else {




_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to