chibicc icon indicating copy to clipboard operation
chibicc copied to clipboard

Size of string is wrong

Open tyfkda opened this issue 3 years ago • 1 comments

When string initializer is parenthesized, its size becomes 1:

const char str[] = {"foo"};

int main() {
    return sizeof(str);
}

Above code should return 4, but 1.

tyfkda avatar Dec 25 '21 00:12 tyfkda

Thanks! This is a bad bug.

rui314 avatar Dec 25 '21 02:12 rui314