This is the mail archive of the gcc@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: Warning policy?



 "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
> |> 	The "label `???' defined but not used" warnings mostly appear in
> |> insn-recog.c.  In this case genrecog.c needs to be fixed.  It may be
> |> non-trivial to deduce which labels are unnecessary, I haven't looked. 
> |> Another approach might be to get the compiler to allow attribute
> |> __unused__ on a label and just mark all of them unused in the generated
> |> insn-recog.c file.

Andreas Schwab writes: 
> Well, the brute force method would be to just emit a `goto L' before
> each label L.

That would only create more warnings, as some of these gotos would be
unreachable code, which produces a warning.

However, if the gotos were only introduced in cases where the code
for the previous node falls through, it would probably be fine.
If there's a simple way to do that, then it might not be bad.
However:

The purpose in removing the warnings is to improve the code quality.
A -Wall-clean compile is nice, but if all the warnings are gone except
for warnings about unused labels in a generated file that would be enough,
in my opinion, for Kaveh to declare victory in his war on the warnings.
The idea is that we can say there should be no warnings except certain
specific warnings in specific files (like this one).



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