This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Partial aggregate initialization warning proposal
- From: "Steven L. Zook" <SLZook at Qualstar dot com>
- To: "Andrew Pinski" <pinskia at physics dot uc dot edu>
- Cc: <gcc at gcc dot gnu dot org>
- Date: Tue, 30 Nov 2004 16:36:53 -0800
- Subject: RE: Partial aggregate initialization warning proposal
I tried -W, -Wall and -W -Wall and still get no errors or warnings. My
complete command line is:
m68k-elf-gcc -save-temps -W -Wall -c testpp.cpp
My output testpp.s is:
.file "testpp.cpp"
.globl PartialInitialized
.data
.align 2
.type PartialInitialized, @object
.size PartialInitialized, 12
PartialInitialized:
.long 0
.long 1
.zero 4
.ident "GCC: (GNU) 3.3.3"
-----Original Message-----
From: Andrew Pinski [mailto:pinskia@physics.uc.edu]
Sent: Tuesday, November 30, 2004 4:05 PM
To: Steven L. Zook
Cc: gcc@gcc.gnu.org
Subject: Re: Partial aggregate initialization warning proposal
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