Ben Shi
-
2015-02-16
- status: open --> closed-fixed
- assigned_to: Ben Shi
- Category: --> Front-end
Regression test gcc-torture-execute-20000801-4.c fails when removing the #if0 in revision number #7275 for some ports.
According to the C standard (section 6.7.9 in the C11 standard), A char array initialized by a string literal is filled with zeroes, but sdcc fails to do so. E.g.:
;test.c:5: char c[5] = "A";
ld hl,#0x0000
add hl,sp
ex de,hl
ld a,#0x41
ld (de),a
ld l,e
ld h,d
inc hl
ld (hl),#0x00
We see that code is only generated for the 'A' and one zero, while the other three zeroes are missing.
Philipp