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

Jeffrey Walton noloader at gmail.com
Sun Aug 28 20:50:15 EDT 2011


On Sun, Aug 28, 2011 at 7:59 PM, Kevin W. Wall <kevin.w.wall at gmail.com> wrote:
> 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.
Agreed, but it did find some members which were not being initialized.

> 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.
OK, that is possible. You will only get the warning when using `make
debug` or `make release`.

> 2) Put up with the warning that GCC spits out.
No. Rule of thumb is a silent and quiet cockpit.

> 3) Get the GCC folks to fix their compiler so that '-Wno-non-virtual-dtor' works
>    like it is expected to.
Hmmm.... I can't even get warnings for unsafe string functions or
globals violating ODR. Fat chance!

> 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,
Don't sweat it - it was a heads up to quiet the warnings. Personally,
I could not care less what the Boost team does, and I won't take the
time to provide them with a heads up or a patch.

> 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.
Why go through this aggravation? Use the heads up, or discard it. If
you discard it, it won't hurt my feelings.

> you (and OWASP) now own a piece of Boost.
I don't want to own a piece of it :)

> 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 won't be making that much effort ;)

> 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.
Agreed. Add a dtor to nil_t and make it virtual, or do nothing.
Everything else is too much work for a foreign header :)

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

Decide what you want to do, and Dan or I can make it happen. If you
yank -Weffc++, you might lose some legitimate warnings (don't let
-Wall -Wextra fool you).

Jeff

> 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