Le mardi 6 janvier 2015, 12:52:06 Sergey Korshunoff a écrit : > v2 of the patch, which uses strtoul() insteed of the parse_number()
As I said, I was just looking for some explanation about why the parse_number was necessary. The reason is that when dealing with TOK_LINE, next() is called. next() will call next_nomacro() and then execute this piece of code: /* convert preprocessor tokens into C tokens */ if (tok == TOK_PPNUM && (parse_flags & PARSE_FLAG_TOK_NUM)) { parse_number((char *)tokc.cstr->data); } And at the top of the function preprocess that deal with TOK_LINE: parse_flags = PARSE_FLAG_PREPROCESS | PARSE_FLAG_TOK_NUM | PARSE_FLAG_LINEFEED; So yeah, the next token after TOK_LINE becomes a number and can be found in tokc.i. If dealing with a #N macro, it would be a TOK_PPNUM and you'd need to use parse_number to turn it into a normal number. Therefore the approach in your first patch was perfectly fine. One thing though: could you rather move parse_number just before preprocess rather than predeclare it? Unless there is a reason for it to be at this place in the file in which case you can at least move the prototype declaration close the next_nomacro_spc () one. Thanks for your patch. Best regards, Thomas _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel