From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31107 invoked by alias); 19 May 2004 21:44:20 -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 31046 invoked by uid 48); 19 May 2004 21:44:17 -0000 Date: Thu, 20 May 2004 20:23:00 -0000 Message-ID: <20040519214417.31044.qmail@sourceware.org> From: "trav at mac 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-05/txt/msg02179.txt.bz2 List-Id: ------- Additional Comments From trav at mac dot com 2004-05-19 21:44 ------- (In reply to comment #10) > You're right. This compiler works in agreement with the requirement, so I > should stop bugging you guys. I guess I'm just not seeing the "why" behind the > requirement. When in is it a perfectly acceptable condition (ie according to - > Wall) not to null-terminate a literal string in an array like this? (I don't > understand the "if there's room" part of the requirement.) And who do I talk > to to challenge requirements so I can leave you alone? > Here is the rationale: Since it is an array of characters, you should be able to use a convenient initializer to specify every element of the array, including the last. Thus, you are allowed to use a double-quoted string, and no null-character will be stored. Not that I agree with making it so easy to create a unterminated string... -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13896