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.


_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to