Buried in warnings
Posted Nov 2, 2006 8:39 UTC (Thu) by pcdavid
Parent article: Buried in warnings
Since version 1.5 and the addition of annotations, Java compilers support a @SuppressWarnings annotation. It can be attached to almost any element in the code (type, method, parameter, local variable, etc.) and is used to silence specific kinds of warnings related to this element. The exact kinds of warnings which can be silenced depend on the compiler, but some are mandatory. For example, if you have a pre-1.5 class which uses non-generic collections, you can add @SuppressWarnings("unchecked") to the class. This essentially tells the compiler "This class uses operations which might seem unsafe to you, but I know what I'm doing so don't bother me about it."
Couldn't the sparse tool be extended to support this kind of things? It could then filter out the output of GCC and remove the warnings which have been accounted for by the developers.
to post comments)