Because not using a function parameter is a legitimate coding
technique, and having to sort through warnings about it to figure out
whether there's a genuine error, or adding extraneous code in order to
suppress bogus warnings, is a distraction.
Leaving parameter that is not going to be used without name is
legitimate technique in C++ how to mark such a parameter in most
laconic way (without adding extraneous code).
Let me describe again the situation when the warning is bogus:
1) Functions signature contains a parameter with what there are
nothing to do in function body.
2) There is reason why to ignore that design problem of virtual
function not managing to do its both tasks well.
3) The bogus parameter still has name for some reason (like other
compiler for other platform that complains when it has no name).
Is it really so "extraneous" to mark that place somehow that it is
exactly as it is supposed to be? I would expect "why?" comment as
well.
But perhaps I assume too
high a degree of professionalism in programmers; if you feel that you
can't write adequate unit tests, or won't run them, then perhaps you
need more help in identifying a low-probability error, and sorting
through the extra noise is worthwhile for you.
Where did you get such nonsense from what i have said? Professionalism
can be enforced by process. Unit tests should be additionally ran by
separate systems. At least one per platform what is supported. These
should automatically run all the tests each time someone pushes
something into main repository of product. So if a developer did not
run the tests on code he broke and the reviewer who pushed it into
main repository also did not notice then whole team will hear about
it.
All i said was that when people have everything: (a) unit tests
failure, (b) repository changeset that caused it and (c) diagnostics
from tools/compilers it will be fixed most quickly. Average programmer
wastes most of his time by dealing unproductively with such "low-
probability errors". Where to take star-programmers who understand
everything on fly? Nowhere. It is lot easier to arrange average joe to
behave professionally. And ... it is good idea to squeeze everything
what is possible out of tools.