[LLVMbugs] [Bug 9669] warn about initializers containing more elements than initialized value

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Apr 11 12:49:41 PDT 2011


Ted Kremenek <kremenek at apple.com> changed:

           What    |Removed                     |Added
             Status|REOPENED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #10 from Ted Kremenek <kremenek at apple.com> 2011-04-11 14:49:41 CDT ---
(In reply to comment #9)
> One example from ffmpeg:
> const char ff_id3v2_tags[][4] = {
>    "TALB", "TBPM", "TCOM", "TCON", "TCOP", "TDLY", "TENC", "TEXT",
>    "TFLT", "TIT1", "TIT2", "TIT3", "TKEY", "TLAN", "TLEN", "TMED",
>    "TOAL", "TOFN", "TOLY", "TOPE", "TOWN", "TPE1", "TPE2", "TPE3",
>    "TPE4", "TPOS", "TPUB", "TRCK", "TRSN", "TRSO", "TSRC", "TSSE",
>    { 0 },
> };
> One example from gcc:
> static const char template[IDENT_LENGTH] = "gpch.012";
> It's a useful construct if you know what you're doing; not all char arrays need
> to be null-terminated.

Fair enough.  It's unfortunate that there is no difference between a char array
and a C string in the C type system.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list