ConfigurationWatchDogThread constructor wrong in config.cc

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
chaircrusher
Posts: 32
Joined: Tue, 2011-12-20, 23:24
Location: iowa city,ia

ConfigurationWatchDogThread constructor wrong in config.cc

#1 Post by chaircrusher »

Clang's complaint:

Code: Select all

dcmtk/oflog/libsrc/config.cc:561:22: warning: field is uninitialized when used here [-Wuninitialized] 
        , waitMillis(waitMillis < 1000 ? 1000 : millis)
                     ^
1 warning generated.
This constructor tries to test the value of a member variable in the course of initializing it. This makes no sense; at constructor time the member variable is GUARANTEED to be uninitialized:

Code: Select all

    ConfigurationWatchDogThread(const tstring& file, unsigned int millis)
        : PropertyConfigurator(file)
        , waitMillis(waitMillis < 1000 ? 1000 : millis)
        , shouldTerminate(false)
        , lock(NULL)
    { }
The net effect is that the one place an instance of ConfigurationWatchDogThread is created, it will get a wait time of 1000 milleseconds, or the specified time, depending on the value of uninitialized memory.

J. Riesmeier
DCMTK Developer
Posts: 2504
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

#2 Post by J. Riesmeier »

Thank you for the report. This issue is now fixed.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest