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: Ziyao
Subject: Re: [Tinycc-devel] Bug that TinyCC Analyses Strings inside #if 0 blocks
Date: Tue, 12 Jul 2022 06:57:41 +0800

On Mon, Jul 11, 2022 at 05:47:31PM +0200, Domingo Alvarez Duarte wrote:
> Hello Ziyao !
> 
> Although gcc compiles a file containing your example with warnings, I'm not
> sure it's worth try to do the same in TiinyCC the preprocessor probably uses
> TOKENS from the lexer to decide to skip till the end of the initial "#if 0"
> and '"' is not a valid token the error probably come from the lexer that
> found a non terminated string.
> 
For conditional inclusion,C99 document says:
        Only the first group whose control condition evaluates to true
        (nonzero) is processed. If none of the conditions evaluates to true,
        and there is a #else directive, the group controlled by the #else is
        processed; lacking a #else directive, all the groups until the
        #endif are skipped.1
In my understanding,the skipped part should NOT be processed.

Ziyao




reply via email to

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