Re: [PATCH 1/7] Rework strbuf API and semantics.
- From
David Kastrup <dak@gnu.org>
- Date
- Sep 6, 2007, 15:06 UTC
- Message-ID
- <85tzq7bzoz.fsf@lola.goethe.zz>
- In-Reply-To
- <20070906145035.GA3546@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 21 quoted lines
> On Thu, Sep 06, 2007 at 04:44:42PM +0200, David Kastrup wrote:
>
>> >> Would not "struct strbuf sb = { 0 };" have the same effect? (I am not so
>> >> standards-keen as other people, who I have no doubt will gladly answer
>> >> this one.)
>> >
>> > Yes, it would, according to the standard.
>>
>> Have a citation for that?
>
> Of course.
>
> See ISO 9899:1999, section 6.7.8.
>
> Paragraph 10:
>
> If an object that has automatic storage duration is not initialized
> explicitly, its value is indeterminate. If an object that has static
> storage duration is not initialized explicitly, then:
>
> -- if it has pointer type, it is initialized to a null pointer;That's actually a new one to me. I don't think that it has been always the case in ANSI C.
Thanks.
-- David Kastrup, Kriemhildstr. 15, 44793 Bochum