fuhsnn / slimcc

C11 compiler with GNU extensions for x86-64 Linux, working towards C23
MIT License
39 stars 6 forks source link

Constant evaluation ignore cast-to-bool #42

Closed fuhsnn closed 1 year ago

fuhsnn commented 1 year ago
#include <stdio.h>
int main(void) {
    printf("%d\n", ({ char a[ (_Bool)2 ]; sizeof(a); })); // expect 1, got 2
    printf("%d\n", ({ char a[ (_Bool)0.1f ]; sizeof(a); })); // expect 1, got 0
}