Menu

No error is reported while checking the sample bad file under AssignmentAddressToInteger

wy163
2024-12-25
2024-12-25
  • wy163

    wy163 - 2024-12-25

    Hi, when checking the file cppcheck-2.16.0/samples/AssignmentAddressToInteger/bad.c, I got nothing to be reported. The target file is one of the samples under the cppcheck source code. My command is something like below.

    ./cppcheck --enable=warning bad.c
    

    Maybe I missed some config or options. Do you know why?Thanks a lot!

     
  • CHR

    CHR - 2024-12-25

    It's a portability check:

    'C:\Program Files\Cppcheck\cppcheck.exe' .\test.cpp --enable=all
    Checking test.cpp ...
    test.cpp:3:11: portability: Assigning a pointer to an integer is not portable. [AssignmentAddressToInteger]
        int a = p;
              ^
    
     

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.