Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- QString newItem( const QString &type, ....)
- {
- QString t = "new "+cfg.inherits+"::Item" + ....;
- if ( type == "Enum" ) t += ", values" + name;
- if ( !defaultValue.isEmpty() ) {
- t += ", ";
- if ( type == "String" ) t += defaultValue; //<==
- else t+= defaultValue; //<==
- }
- t += " );";
- return t;
- }
- This suspicious code was found in KDE4 project by PVS-Studio static code analyzer.
- Warning message is:
- V523 The 'then' statement is equivalent to the 'else' statement. kconfig_compiler.cpp 1051
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment