static code analysis - cppcheck: same expression on both sides maybe wrong -


#ifdef test #define invalid_handle_value 0 #else #include <windows.h> #endif   int main() { handle hf = 0; if (hf==0 || hf==invalid_handle_value) {} } 

above test code, when use cppcheck.exe(1.58) check code, cppcheck give me 'style' error enter image description here seems cppcheck think hf == 0 , hf == invalid_handle_value same expression. can tell me cppcheck's bug or why code style error

i cppcheck developer.

i agree wrong warning.

however cppcheck preprocess code. if want have warnings real issues it's inevitable such false warnings (the conditions logically same).

maybe check should activated --inconclusive, since there can false warnings when macros used.

if can live false warning i'd suggest it. if want fixed feel free write ticket: http://sourceforge.net/apps/trac/cppcheck/


Comments

Popular posts from this blog

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

Android Gson.fromJson error -