tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Constant Initializer for Static Variables


From: Elijah Stone
Subject: Re: [Tinycc-devel] Constant Initializer for Static Variables
Date: Wed, 13 Apr 2022 18:56:55 -0700 (PDT)

const vars are not integer constant expressions; your code is not guaranteed to work. Some gnu exts are implemented; this one is not.

On Thu, 14 Apr 2022, Ziyao wrote:

Hi list,

I recently found that TinyCC complaint about code like this

int main(void)
{
        const int one = 1;
        static const int a = one;       // error: initializer element is
                                        // not constant
        return 0;
}

But GCC10 and Clang11 both accept it.

Ziyao


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



reply via email to

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