On 04/17/2016 06:41 PM, scan-admin@coverity.com 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: support@coverity.com
From: Stephan Bergmann <sbergman@redhat.com>
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.
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.