From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16203 invoked by alias); 28 Jan 2004 16:52:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 16187 invoked by uid 48); 28 Jan 2004 16:51:58 -0000 Date: Wed, 28 Jan 2004 16:52:00 -0000 Message-ID: <20040128165158.16186.qmail@sources.redhat.com> From: "rhajdaj at yahoo dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040128132357.13896.rhajdaj@yahoo.com> References: <20040128132357.13896.rhajdaj@yahoo.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c/13896] Initializer string warning not printed if implied NULL-terminator out of bounds X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg03596.txt.bz2 List-Id: ------- Additional Comments From rhajdaj at yahoo dot com 2004-01-28 16:51 ------- I suppose it's blasphemy to disagree with that requirement, but since '\0' is indeed an element of any array containing it (implicitly or otherwise), it's my opinion that the requirement (though it might satisfy the letter of some law), disagrees with descriptions of string literals like (K & R p. 38): "The internal representation of a string has a null character '\0' at the end, so the physical storage required is one more than the number of characters written between the quotes." So a[0][] (using the a[][3] = {{"Hel"}, {"Hi"}} example) must take up 4 bytes. Given the requirement, you're right. I got nothin. But the requirement seems bogus to me. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13896