labelled expression statement is marked as ‘void’ within statement expression
zamfofex opened this issue · 2 comments
zamfofex commented
#include <stdio.h>
int main(void)
{
printf("%d\n", ({bar: 1234;}));
return 0;
}
GCC is fine with this, and the program shows 1234
at runtime.
With chibicc, I get an error:
test.c:5: printf("%d\n", ({bar: 1234;}));
^ statement expression returning void is not supported
rui314 commented
This is an undefined behavior, so the compiler is allowed to do report the problem or just ignore.