Partial aggregate initialization warning proposal

Andrew Pinski pinskia@physics.uc.edu
Wed Dec 1 00:05:00 GMT 2004


On Nov 30, 2004, at 6:59 PM, Steven L. Zook wrote:

> Using GCC 3.3.3 (and presumably later revisions), I compile following
> test C++ program fragment (the definition is at global scope):
>
> int PartialInitialized[ 3 ] = { 0, 1 };
>
> I get no warnings or errors. GCC is behaving correctly since
> (INCITS+ISO+IEC+14882-2003) 8.5.1-7 calls out for value-initialization
> for the non-explicitly initialized members.


Yes try with "-W -Wall", you will get a warning.

Thanks,
Andrew Pinski



More information about the Gcc mailing list