J
John Smith
Hi,
I have a question regarding the initialisation of aggregates:
The C (99) standard states:
section 6.7.8, paragraph 21 states:
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.
Does "remainder" here refer to padding as well or just field types (for
aggregates)? My experiments with gcc seem to indicate padding is zeroed as
well but I just want to confirm.
Thanks
I have a question regarding the initialisation of aggregates:
The C (99) standard states:
section 6.7.8, paragraph 21 states:
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.
Does "remainder" here refer to padding as well or just field types (for
aggregates)? My experiments with gcc seem to indicate padding is zeroed as
well but I just want to confirm.
Thanks