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

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -