[Ffmpeg-devel] [PATCH] Merge some changes from xine-lib's ffmpeg patch
Måns Rullgård
mru
Thu Jun 29 02:11:49 CEST 2006
Diego 'Flameeyes' Petten? <flameeyes at gentoo.org> writes:
>> > + NULL, NULL, NULL, NULL
>> rejected, this change is random, inconsistent and unneeded
> Uhm, it's not random. It adds the initialisation of the structure
> members, or they would be uninitialised (as in, random content). GCC
> 4 issues a warning about it. This actually it's not in xine-lib's
> patch, but I hit it by chance and fixed locally, I should have moved
> it on its own patch, most likely.
ISO/IEC 9899:1999, section 6.7.8 Initialization:
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.
[...]
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.
Case closed.
If gcc issues a warning, gcc is at fault and should be fixed. Feel
free to attempt discussion with the gcc devs ;-)
--
M?ns Rullg?rd
mru at inprovide.com
More information about the ffmpeg-devel
mailing list