rui314/chibicc

labelled expression statement is marked as ‘void’ within statement expression

zamfofex opened this issue · 2 comments

#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

This is an undefined behavior, so the compiler is allowed to do report the problem or just ignore.

Oops, sorry, this is a duplicate of #37.