This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12188] New: null char array initializer skipped
- From: "pat at outerreaches dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Sep 2003 03:17:51 -0000
- Subject: [Bug c/12188] New: null char array initializer skipped
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.