This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

Re: clobbered warning


> > Yes, this looks like a bug.
> 
> Thanks for the reply, Martin. Do you agree with me that
> the implementation is incorrect? Or is it the documentation?

I have no specific feelings in either direction, since I have no
intuition what the various -W* options should do. In fact, this was
the first time I noticed that -W is *more* than -Wall - I would have
guessed that -Wall includes -W.

Based on your report, I think the implementation is incorrect - the
documentation sounds very certain that you don't want this warning in
-Wall.

> Either way, should I be looking at providing a patch for this part?

I'm not a maintainer, but I think it would be good if that is fixed. A
short analysis shows that extra_warnings is not considered before
printing these messages.

> I understand. I personally find it a little inconsistent to warn in
> one case and not another. I guess the documentation could be made to
> explicitly state that the warning is not produced simply because the
> information is not to hand.

It's a bit more complicated. Please try your example with
-Wuninitialized -O0 - you will get a warning that -Wuninitialized
requires optimization. You'll also find that this warning is *not*
issued with -Wall -O0, since people would always get the warning
when the just use -Wall.

Putting it in the documentation is probably the right thing (again,
cf. the documentation for -Wuninitialized). If you find a way to solve
this in the compiler, even better.

> I am pretty sure that it is possible. Would gcc-patches be the
> appropriate place to post my thoughts on how it could be
> implemented? Or do they only want actual code implementations?

gcc-patches should be used for patches only, and for discussion of the
specific patches suggested. Please use the gcc list. Also, experience
shows that it is much more difficult to discuss thoughts than to
discuss a specific patch. GCC is a very complex thing, and everybody
knows a different bit in detail. With a specific patch, it is much
more easy to see in what cases it works and what code it breaks.

> Is there any way to know whether I would be duplicating effort if I
> were to have a go at this?

It is *very* unlikely that there is duplicate effort in that area. If
you use the CVS code, you have 99.99% or so of the current code. Some
people have work-in-progress code at home, but they will raise their
voice if they see a conflict. Some companies (e.g. Cygnus) have
not-yet-released code for gcc, but it is not guaranteed that such code
will ever make it into the mainline gcc. Also, employees of these
companies also listen to the gcc list, and will notify you about
potential conflicts.

Good luck,
Martin


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