Hello! 

Report a bug about parsing "#include" line.


--------------------------------------------------------------------------------


Bug info:


File: tccpp.c

Line: near 1374
Function: parse_include




--------------------------------------------------------------------------------


Test code:




#include <stdio.h&gt;  int main(int argc, const char **argv) { return 0; }


int main(int argc, const char **argv)
{
    printf("Hello, World\n");
    return 0;
}




--------------------------------------------------------------------------------


Problem:


In GCC, the above test code can be compiled&nbsp;successfully. It seems 
that&nbsp;
GCC skip the code after '&gt;'.


In TCC, it don't check the code after '&gt;', just take the code as normal code.


According to C99, whitespace is the only character that can appear after&nbsp;
'&gt;'. Comments are take as&nbsp;whitespace.


--------------------------------------------------------------------------------


Fix:


It seems that the following code need be added to near line&nbsp;1374 in 
"tccpp.c".


    while (tok != TOK_LINEFEED)
        next_nomacro();











837806295
837806...@qq.com






&nbsp;
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to