On 2022-07-12 10:31:26 +0800, Ziyao wrote:
> ----- Original Message ----- 
> From: "Vincent Lefevre" <vinc...@vinc17.net>
> To: tinycc-devel@nongnu.org
> Sent: Tue, 12 Jul 2022 02:44:50 +0200
> Subject: Re: [Tinycc-devel] Bug that TinyCC Analyses Strings inside #if 0 
> blocks
> >  That's why I said that there should be
> > a diagnostic. So the missing diagnostic with tcc is a bug.
> > If the program is not rejected, the behavior is undefined.
> So is it better to throw an error and then stop 
> compiling here like gcc?

With GCC, this is an error only with -pedantic-errors or similar.
But there is at least a warning.

> Or just print a warning?

Since one cannot rely on portable behavior (the code is really
ambiguous, with no natural interpretation), I think that an error
would be better.

I think that the fact that GCC just emits a warning is that it
assumes that in practice, the preprocessor will not be involved.
But it may be wrong and the result may be unexpected by the user.

-- 
Vincent Lefèvre <vinc...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

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

Reply via email to