Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760271AbXHBX0q (ORCPT ); Thu, 2 Aug 2007 19:26:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751893AbXHBX0i (ORCPT ); Thu, 2 Aug 2007 19:26:38 -0400 Received: from mail.gmx.net ([213.165.64.20]:40001 "HELO mail.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751158AbXHBX0h (ORCPT ); Thu, 2 Aug 2007 19:26:37 -0400 X-Authenticated: #20450766 X-Provags-ID: V01U2FsdGVkX1+moFsfRmKmBP35V+1mOsbKl6vNdThAMSHXYohIrx z4ppmEYmKf8BP5 Date: Fri, 3 Aug 2007 01:26:40 +0200 (CEST) From: Guennadi Liakhovetski To: Randy Dunlap cc: Robert Hancock , Stefan Richter , Andi Kleen , linux-kernel@vger.kernel.org Subject: Re: gcc fixed size char array initialization bug - known? In-Reply-To: <20070802155434.b085219c.rdunlap@xenotime.net> Message-ID: References: <46B2578A.805@s5r6.in-berlin.de> <20070802155434.b085219c.rdunlap@xenotime.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Y-GMX-Trusted: 0 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1000 Lines: 25 On Thu, 2 Aug 2007, Randy Dunlap wrote: > C99 spec that Al referred you to (available for around US$18 as a pdf) > says in 6.7.8, para. 14 (where Al said): > > "An array of character type may be initialized by a character string literal, optionally > enclosed in braces. Successive characters of the character string literal (including the > terminating null character if there is room or if the array is of unknown size) initialize the > elements of the array." Wow... So, the terminating '\0' in the string constant IS "special" and "optional"... Ok, then, THIS does answer my question, THIS I can understand, and, ghm, accept... Thanks to all who tried to explain this to me and sorry it took so long... Thanks Guennadi --- Guennadi Liakhovetski - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/