------- Comment #16 from mark at codesourcery dot com  2009-01-25 20:03 -------
Subject: Re:  [4.4 regression] Compiler warns about
 uninitialized variable that is an object with a constructor

rguenther at suse dot de wrote:

>> Therefore, I don't think that the key here is "zero-size".  Instead, it's the
>> fact that structure cannot be initialized.  That's useful both for warnings 
>> and
>> for optimization; it can't be initialized, so there's no point about warning
>> about uninitialized uses, and there's no reason to actually generate code for
>> the copies.
> 
> Ok, I think mapping cannot be initialized to zero-size is ok, as that is
> the only thing we can currently query (and we even specialize this
> for C++ to deal with the 1 byte vs. empty case).

Yes, I think it's OK to approximate "logically empty" by "zero-size" at
present.  It might be worth either changing the zero-size
documentation/name to reflect that it means "logically empty" (if we
think these are the same concept) or else defining a separate
LOGICALLY_EMPTY_P predicate (implemented by checking for zero size) as a
hedge against separating them (if we think they are usefully distinct
concepts).

> It's a P1 defect as we didn't warn for uninitialized structure
> uses in any previous relelase.  While we can argue that it is safe
> to downgrade this to P2 I think we should at least try to fix this
> issue for 4.4.0.

I don't mind fixing it, of course, and it would certainly be better to
do so.  But, at the end of the day, if everything else is ready, I'd be
opposed to holding up the release for this.

Thanks,


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38851

Reply via email to