This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: a warning to implement
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Joe Buck <jbuck at synopsys dot com>
- Cc: dewar at gnat dot com (Robert Dewar), gdr at codesourcery dot com, phil at jaj dot com, gcc at gcc dot gnu dot org
- Date: 06 Feb 2002 20:03:42 -0200
- Subject: Re: a warning to implement
- Organization: GCC Team, Red Hat
- References: <200202061850.KAA04584@atrus.synopsys.com>
On Feb 6, 2002, Joe Buck <jbuck@synopsys.com> wrote:
>> On Feb 6, 2002, dewar@gnat.com (Robert Dewar) wrote:
>>
>> > One thing I realize I am confused about now, is it *currently* the case
>> > that gcc documents that
>>
>> > int a = a;
>>
>> > suppresses warnings on a, or is this just a proposed feature?
> Alexandre writes:
>> I've only proposed it as a feature. I don't think this is
>> documented as such.
> It is currently the case *by accident*, and this accident is particularly
> bad in C++, as it suppresses uninitialized variable warnings in
> constructor calls that users would like to see.
> Evidently Alexandre would like to document this accident.
I hereby withdraw my suggestion, in case I haven't done so yet.
Thanks for pointing out my glaring mistake *blush* :-) It's indeed
bogus. At the very least, the use of a's rvalue in the RHS of its
first assignment should be warned about. Perhaps this would be
enough, and we don't need any further warnings?
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist Professional serial bug killer