Jeff King [off-list ref] writes:
On Thu, Sep 06, 2007 at 03:09:28PM +0100, Johannes Schindelin wrote:
quoted
let me thank you for this very nicely done patch series. Except for 5/7,
they look pretty much obvious changes to me. I'll review that in detail
later.
I second that; I am glad somebody is taking an interest in this area
(though I haven't closely reviewed the patches yet).
quoted
quoted
+#define STRBUF_INIT { 0, 0, 0, NULL }
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?
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
On Thu, Sep 06, 2007 at 04:44:42PM +0200, David Kastrup wrote:
quoted
quoted
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;
-- if it has arithmetic type, it is initialized to (positive or
unsigned) zero;
-- if it is an aggregate, every member is initialized (recursively)
according to these rules;
-- if it is a union, the first named member is initialized (recursively)
according to these rules.
Paragraph 21:
If there are fewer initializers in a brace-enclosed list than there
are elements or members of an aggregate, or fewer characters in a
string literal used to initialize an array of known size than there
are elements in the array, the remainder of the aggregate shall be
initialized implicitly the same as objects that have static storage
duration.
-Peff