On 04/17/2016 06:41 PM, [email protected] wrote:
*** CID 1358589:  Uninitialized members  (UNINIT_CTOR)
/tools/source/generic/fract.cxx: 45 in Fraction::Impl::Impl()()
39
40     struct Fraction::Impl
41     {
42         bool                        valid;
43         boost::rational<sal_Int64>  value;
44
     CID 1358589:  Uninitialized members  (UNINIT_CTOR)
     Non-static class member "valid" is not initialized in this constructor nor 
in any functions that it calls.
45         Impl() = default;
46         Impl(const Impl&) = delete;
47         Impl& operator=(const Impl&) = delete;
48     };
49
50     Fraction::Fraction() : mpImpl(new Impl)

FYI: Sent the below to Coverity about the above and similar, that now unhelpfully start to crop up.



To: [email protected]
From: Stephan Bergmann <[email protected]>
Subject: Coverity Scan: False UNINIT_CTOR in defaulted constructor
Date: Mon, 18 Apr 2016 08:55:55 +0200

(I did not find another way to report this problem with Coverity Scan.
Both the "Coverity Community" and "Coverity Developer Forums" links at
<https://scan.coverity.com/about> go to "down for maintenance. We will
be back in early 2016" pages.)

If you have a C++ struct S with implicitly declared default ctor, Scan
does not emit any UNINIT_CTOR warnings for S' non-static data members:

   struct S {
    int x;
   };

However, if you give it a user-declared defaulted default ctor,

   struct S {
    int x;
    S() = default;
   };

then Scan starts to emit unhelpful UNINIT_CTOR issues, see e.g.
<https://scan5.coverity.com/reports.htm#v21426/p10276/fileInstanceId=91551340&defectInstanceId=26696003&mergedDefectId=1358589>
in the LibreOffice code.

It would be great if Scan could be configured to not emit issues in that
case.
_______________________________________________
LibreOffice mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to