[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Tinycc-devel] Integer constant expression bug
From: |
Petr Skocik |
Subject: |
[Tinycc-devel] Integer constant expression bug |
Date: |
Thu, 20 May 2021 11:12:23 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
Hi.
Not sure if this is news but tinycc treats certain values which are
definitely not integer constant expressions as if they were.
Examples:
#define CEXPR_EH(X) _Generic((1? (void *) ((!!(X))*0ll) : (int *) 0),
int*: 1, void*: 0)
//ok
void should_be_ok1(void) { enum{x=0}; _Static_assert(CEXPR_EH(x),""); }
//each of these fails on tinycc
void should_be_ok2(void) { extern int x;
_Static_assert(!CEXPR_EH(x),""); }
void should_be_ok3(void) { int x=0; _Static_assert(!CEXPR_EH(x),""); }
void should_be_ok4(int x) { _Static_assert(!CEXPR_EH(x),""); }
void should_be_ok5(void) { double x=0; _Static_assert(!CEXPR_EH(x),""); }
void should_be_ok6(void) { extern double y;
_Static_assert(!CEXPR_EH(y),""); }
void should_be_ok7(void) { char *x=0 ; _Static_assert(!CEXPR_EH(x),""); }
void should_be_ok8(char *x) { _Static_assert(!CEXPR_EH(x),""); }
Regards,
Petr S.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Tinycc-devel] Integer constant expression bug,
Petr Skocik <=