This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: a warning to implement

On Feb  6, 2002, Joe Buck <> wrote:

>> On Feb  6, 2002, (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
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist                Professional serial bug killer

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]