fuhsnn / slimcc

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

Wrong value from relocation pointer casted to boolean #85

Closed fuhsnn closed 3 weeks ago

fuhsnn commented 3 weeks ago
#include <stdio.h>

int i = (_Bool)&printf;

int main(void) {
    printf("%d\n", i); // expect 1, got pointer address
}

GNU extension.