Also sprach Anno Siegel:
Okay, but that happens only with global -w, not with lexical "use warnings".
h2xs puts 'use warnings' into the created module skeleton. Those modules
will emit warnings even if -w or warnings are turned off in the program
using this module.
Yes. See below.
If a module issues warnings the author didn't intend the user to see,
that's a bug. Most of the time it is trivially fixed.
Ah, but there the warning itself becomes the bug. The trivial fix would
be getting rid of 'use warnings' within the module. No warning, hence no
bug. ;-)
There is obviously something very contorted in this logic just outlined.
But it is the direct implication of your assertion that a warning
produced by a module is a bug.
If the module author has "use warnings" early in each file as a matter of
course, these problems are caught during development. Unfortunately, h2xs
issues a module template without warnings. That may be a reason why the
practice isn't more common.
I just checked it (again). h2xs puts them in, unless a version older
than 5.6 is specified using -b or --skip-warnings is mentioned
explicitly.
Interestingly enough, I just noticed that I preach things differently
from how I do them in the modules I have released. Most of my modules
have warnings on in fact. I even go through painful procedures to
temporarily switch them off in XS code where necessary and turning them
on again afterwards. Hmmh.
What about silently delivering wrong results?
It's not at all clear to me how wrong results correlate with the amount
of warnings emitted. I will admit that the likelihood of warnings is
probably higher when a wrong result is being computed (and vice versa).
However, there will still be many cases where those two things will be
entirely uncorrelated. If anything, warnings from a module will give me
doubts about the quality of the module in question.
Really? I'd understand "(not) useful to the people running the program",
but as a developer I'm just as interested in warnings as I am in errors.
I see myself as a plain user when it comes to external modules and
libraries. It is true that in some cases I might lay hands on their code
but in most cases I will start looking for less noisy alternatives. It's
not always practical (let alone easy) to dive into other people's code
and fix things.
Tassilo