top | item 10867378

(no title)

jamessu | 10 years ago

I was going to remark on this. I've personally run into this writing some C that was built on multiple platforms, one of which had c99 and one of which did not (c89 instead).

I think the real issue here is the inconsistency between C standards on details like this. If you can always assume that your code is built with c99 or later, then use all of its features, but in many cases that's not a realistic assumption.

discuss

order

DerekL|10 years ago

I think that this rule applies to C89 too. I don't have an official copy of the standard, but I found a draft here: http://port70.net/~nsz/c/c89/c89-draft.html#3.5.7

“If there are fewer initializers in a list than there are members of an aggregate, the remainder of the aggregate shall be initialized implicitly the same as objects that have static storage duration.”