New Defects reported by Coverity Scan for LibreOffice

Stephan Bergmann sbergman at redhat.com
Mon Jan 23 10:40:58 UTC 2017


On 01/23/2017 11:10 AM, Caolán McNamara wrote:
> On Mon, 2017-01-23 at 10:03 +0100, Stephan Bergmann wrote:
>> This appears to be irrespective of any (dynamic) exception
>> specifications, so is unlikely to go away with the ongoing work for
>> <https://lists.freedesktop.org/archives/libreoffice/2017-January/0766
>> 65.html>
>> "Dynamic Exception Specifications".
>
> Yeah, I upgraded out coverity to the latest 8.7.0, hence the new
> exception warnings on exceptions possibly thrown from dtors.
>
> Note too that the checks just examine what methods could possibly be
> called on any given code path through the code, not just the one used
> in the dtor so
>
> foo::~foo()
> {
>     thing(false);
> }
>
> void thing(bool bar)
> {
>     if (bar)
>        throw something
> }
>
> gets a warning.
>
> Presumably adding noexcept(false) to things will generally have to wait
> until the dynamic exception specification stuff is in place cause the
> top of the various hierarchies need the loosest throw specs for
> inherited things to loosen theirs to noexcept(false)

I don't think adding noexcept(false) to such dtors would be good.  They 
are surely not meant to throw.

Is there no way to disable that unhelpful warning?


More information about the LibreOffice mailing list