Closed
Description
The following example:
#define C1 (int) ( 0. / 1. + 0.5)
#define C2 (int) ( 1. / 1. + 0.5)
extern int g_c;
int g_out;
void main(void)
{
switch (g_c)
{
case C1:
g_out = 1;
break;
case C2:
g_out = 2;
break;
default:
break;
}
}
Used to be able to be compiled by goto-cc, but since #2490 was merged this example now fails to compile due to a type check failure:
goto-cc test.c
test.c: In function 'main':
test.c:11:1: error: expected constant expression, but got `(signed int)(0.0 / 1.0 + 0.5)'
CONVERSION ERROR