[Owasp-esapi-c++] Boost::Test nil_t warnings

Kevin W. Wall kevin.w.wall at gmail.com
Sun Aug 28 19:59:58 EDT 2011


Look, I think it should be obvious that this is a bogus warning.
You would agree, would you not? Meyer's points are rules-of-thumb,
not dogma.

So, if -Wno-non-virtual-dtor doesn't suppress the warning, I would suggest
one of four OTHER courses:
1) Don't use -Weffc++ for compiling the Boost tests.
2) Put up with the warning that GCC spits out.
3) Get the GCC folks to fix their compiler so that '-Wno-non-virtual-dtor' works
    like it is expected to.
4) Build a 'patch' file to apply to the standard Boost header file and a note to
    the readme (or provide a new readme) describing what the patch file is for
    and how to apply it.

I am *not* fond of the solution that you chose *unless* you can convince
the Boost dev team to pick up your change, and I just don't see that as
happening. The problem that I see if you edit this is that you now need to
provide this modified Boost 'boost/test/unit_test_suite.hpp' header file and
use it instead of the standard Boost header. Which means more or less
you (and OWASP) now own a piece of Boost. Furthermore, as Boost is
installed by default on some systems, you will have to change the #include
for it so that your modified one is now picked up instead of any standard one
that may be installed in /usr/include/boost.

I can live with any of the other 3 alternatives that I've offered, but I am not
comfortable living with owning a piece of Boost. That can only be problematic
later own. Basically, it means that we have to track all their changes
and provide
regular updates of it when the Boost team changes their unit_test_suite.hpp
header file. It just doesn't see worth it to me.

-kevin
P.S.- Apologies for the grumpy tone. Papa bear didn't get his nap this
afternoon! ;)

On Sun, Aug 28, 2011 at 7:33 PM, Jeffrey Walton <noloader at gmail.com> wrote:
> Hi All,
>
> Changing warnings to include -Weffc++ (Scott Meyer's Effective C++ and
> More Effective C++) causes a lot of noise from the boost test suite.
> The warning is the nil_t structure is a base class and does not have a
> virtual destructor.
>
> -Wno-non-virtual-dtor does not appear to supress the warning when
> invoked with -Weffc++. The easiest fix appears to be a hack of the
> nil_t structure.
>
> Jeff
>
> $ su -
> password:
> # gedit gedit /usr/include/boost/test/unit_test_suite.hpp
>
> PREVIOUS:
> struct nil_t { }
>
> MODIFIED:
> struct nil_t
> {
>  explicit nil_t() { }
>  virtual ~nil_t() { }
> };
> _______________________________________________
> Owasp-esapi-c++ mailing list
> Owasp-esapi-c++ at lists.owasp.org
> https://lists.owasp.org/mailman/listinfo/owasp-esapi-c++
>



-- 
Blog: http://off-the-wall-security.blogspot.com/
"The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We *cause* accidents."        -- Nathaniel Borenstein


More information about the Owasp-esapi-c++ mailing list