Package: cppcheck
Version: 1.54-1
Severity: normal

--- Please enter the report below this line. ---

Hi,

I think i have found a false positive.
When i use a delegating constructor (c++11 feature), cppcheck report that my 
variables are not initialized.

The command: cppcheck --enable=all --std=c++11 main.cpp
The output:
[main.cpp:11]: (warning) Member variable 'Coordinate::x' is not initialized in 
the constructor.
[main.cpp:11]: (warning) Member variable 'Coordinate::y' is not initialized in 
the constructor.

Thanks!

--- System information. ---
Architecture: amd64
Kernel:       Linux 3.2.0-3-rt-amd64

Debian Release: wheezy/sid
  500 testing         security.debian.org 
  500 testing         ftp.fr.debian.org 

--- Package information. ---
Depends                (Version) | Installed
================================-+-=============
libc6                   (>= 2.4) | 2.13-35
libgcc1             (>= 1:4.1.1) | 1:4.7.1-7
libpcre3               (>= 8.10) | 1:8.30-5
libstdc++6              (>= 4.6) | 
libtinyxml2.6.2                  | 


Package's Recommends field is empty.

Package's Suggests field is empty.






-- 
Judicaël <ash...@rocketmail.com>
class Coordinate{
    private:
        int x;
        int y;

    public:
        Coordinate();
        Coordinate(int x, int y);
};

Coordinate::Coordinate():Coordinate(0, 0){}
Coordinate::Coordinate(int x, int y): x(x), y(y){}

Reply via email to