Re: [Tinycc-devel] Report a Bug about Parsing "#include" Line

2024-03-21 Thread 837806295 via Tinycc-devel
 I think an error should be signalled, instead?

Yes, your advice is best! It should be done this way. 

837806...@qq.com
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Report a Bug about Parsing "#include" Line

2024-03-21 Thread Pierpaolo Bernardi
On Thu, Mar 21, 2024 at 1:25 PM 837806295 via Tinycc-devel
 wrote:

> Report a bug about parsing "#include" line.

> In GCC, the above test code can be compiled successfully. It seems that
> GCC skip the code after '>'.
>
> In TCC, it don't check the code after '>', just take the code as normal code.
>
> According to C99, whitespace is the only character that can appear after
> '>'. Comments are take as whitespace.

So, looks like neither GCC nor TCC are correct in this case.
> It seems that the following code need be added to near line 1374 in
> "tccpp.c".
> Fix:
>
>
> while (tok != TOK_LINEFEED)
> next_nomacro();

I think an error should be signalled, instead?

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel