[Bug c/12188] New: null char array initializer skipped
pat at outerreaches dot com
gcc-bugzilla@gcc.gnu.org
Sat Sep 6 03:17:00 GMT 2003
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12188
Summary: null char array initializer skipped
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pat at outerreaches dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: 2.95.3-7
GCC host triplet: windows98
GCC target triplet: m68hc11
char foo[5] = {'\0', ' ', 'a', 'b', 'c'};
The first null initializer ('\0') is skipped, so foo starts at the second entry
(' '). I.e. foo[0] == ' ', foo[1] == 'a', etc. (If there's some standard that
defines this as correct, my apologies, but it seems wrong to me.)
This is the M68HC11/M68HC12 version of gcc, hosted on windows98.
More information about the Gcc-bugs
mailing list