views:

58

answers:

1

I have some classes that implement interfaces, some of which have methods whose parameters are by definition unused in the particular class implementation. e.g. A "Shape" interface may define a "contains(point)" method, but my particular class defines a line, which cannot contain anything since it's 1-dimensional, so it always returns false and never uses point.

However, when I compile with GCJ, I'm assaulted with hundreds of "warning: parameter x is unused" messages.

I tried using the -Wno-all flag to disable warnings, as well as the others documented in gcj's manpage, but these have no effect. How do I instruct GCJ to not bother me with these trivial warnings?

+1  A: 

Although I haven't found an option to do this directly with gcj, one workaround is to pipe the output into grep and look for the pattern "error:", and then only show that line and a few surrounding lines.

e.g. javac *.java 2>&1 | grep -B 3 -A 2 "error:"

Chris S