|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-07 06:24:49
From: "Beman Dawes" <bdawes_at_[hidden]>
> At 09:25 AM 8/6/2002, Pete Becker wrote:
>
> >At 09:15 AM 8/6/2002 -0400, Beman Dawes wrote:
> >>The new regression test reporting [optionally] makes compiler warnings
> >>visible. That seemed to be a Good Thing, but it isn't 100% obvious
> which
> >>warnings we should be chasing.
> >
> >Warnings create, in essence, language variations. Today they're one of
> the
> >biggest obstacles to portability.
>
> Sigh... I'm afraid you're right.
>
> That would argue for either not reporting warnings at all, or only
> reporting warnings that are likely to be common to many platforms.
>
> I'd like to hear from others. Or maybe nobody cares about warnings and we
> should forget the whole idea.
I won't go into philosophical arguments about warnings. Let's examine some
examples:
c:\boost\site\libs/bind\mem_fn_derived_test.cpp:
Warning W8030 c:\boost\site\libs/bind\mem_fn_derived_test.cpp 97: Temporary
used for parameter 'u' in call to 'operator () <X *>(X * &) const' in
function main()
This exposes a bug in the compiler. The wrong overload is chosen. The test
still works, but forewarned == forearmed (insert incorrect latin translation
here.)
C:/boost/site/libs/smart_ptr/shared_ptr_test.cpp:36: warning: `struct X' has
virtual functions but non-virtual destructor
A perfectly legitimate warning. Using non-virtual destructors in classes
with virtual functions is a common mistake. shared_ptr_test.cpp contains a
comment that explains that the non-virtual destructor is a deliberate
choice. Perhaps a protected destructor will avoid the warning, I don't have
g++ 3 to test.
On the other end of the spectrum, of course, are the MSVC 6 warnings we all
know and love, like "function not inlined" or "function inlined" or
"identifier truncated in debug info" and Borland warnings like "functions
containing try are not expanded inline." They may have some value for
single-compiler-universe programmers, but are quite useless in portable
code.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk