This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/12188] New: null char array initializer skipped


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]