Menu

cppcheck meets clang-14

dcb
2022-04-06
2022-04-07
  • dcb

    dcb - 2022-04-06

    I just tried to compile today's trunk cppcheck with new C/C++ compiler clang-14.
    It said:

    $ fgrep warning: mk.clang.out
    lib/checkcondition.cpp:477:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
    lib/checkcondition.cpp:538:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
    lib/checkcondition.cpp:804:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
    lib/checkcondition.cpp:819:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
    lib/checkcondition.cpp:834:9: warning: use of bitwise '&' with boolean operands [-Wbitwise-instead-of-logical]
    lib/tokenize.cpp:9639:48: warning: unused parameter 'tok1' [-Wunused-parameter]
    lib/tokenize.cpp:9645:1: warning: function declared 'noreturn' should not return [-Winvalid-noreturn]
    lib/valueflow.cpp:868:44: warning: use of bitwise '|' with boolean operands [-Wbitwise-instead-of-logical]
    $

    Some of these might be worth fixing.

     
  • Paul Fultz

    Paul Fultz - 2022-04-07

    Most of those are FPs. We have a similar check in cppcheck but we only warn when there is no side effects.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.