This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Warning policy?
- To: schwab at issan dot informatik dot uni-dortmund dot de (Andreas Schwab)
- Subject: Re: Warning policy?
- From: Joe Buck <jbuck at Synopsys dot COM>
- Date: Wed, 30 Dec 98 19:21:26 PST
- Cc: ghazi at caip dot rutgers dot edu, chip at perlsupport dot com, pfeifer at dbai dot tuwien dot ac dot at, egcs at cygnus dot com
"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).