lkml.org 
[lkml]   [2007]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: gcc fixed size char array initialization bug - known?
On 08/03/2007 01:26 AM, Guennadi Liakhovetski wrote:

> 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...

Ah come on, it would be great fun to now make the argument that that quoted
bit doesn't actually say wat should happen when there's _no_ room for the
terminating null character...

Rene.
-
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/

\
 
 \ /
  Last update: 2007-08-03 01:39    [W:0.423 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site