tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Bug that TinyCC Analyses Strings inside #if 0 blocks


From: Vincent Lefevre
Subject: Re: [Tinycc-devel] Bug that TinyCC Analyses Strings inside #if 0 blocks
Date: Tue, 12 Jul 2022 05:35:50 +0200
User-agent: Mutt/2.2.6+26 (7d9df177) vl-149028 (2022-07-06)

On 2022-07-12 10:31:26 +0800, Ziyao wrote:
> ----- Original Message ----- 
> From: "Vincent Lefevre" <vincent@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 <vincent@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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]