This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: warning: '<some_var>' may be used uninitialized in this function
- From: "Dave Korn" <dave dot korn at artimi dot com>
- To: <Christian dot Iseli at licr dot org>, <gcc at gcc dot gnu dot org>
- Cc: "'Diego Novillo'" <dnovillo at redhat dot com>, "'Perry Smith'" <pedz at easesoftware dot net>
- Date: Thu, 12 Jan 2006 15:54:09 -0000
- Subject: RE: warning: '<some_var>' may be used uninitialized in this function
Christian.Iseli@licr.org wrote:
> But... it used to be the case that the compiler didn't try to warn about
> uninitialized variables embedded in structs (or so I seem to remember...)
> So I was wondering if this was some kind of regression...
I would consider that to be a bug, not a feature. Just because an object is
in a struct doesn't mean its initialisation status is the same as that of the
other objects in the struct, that's a false inference, and there's a whole
category of bugs that revolve around partially initialising a struct but
forgetting one (or more) of the members, so I'd suggest that this was never a
partiuclarly desirable way for the warning to work anyway.
cheers,
DaveK
--
Can't think of a witty .sigline today....