Menu

aarch64: false positive invalidPrintfArgType_sint in string formatting

2024-11-29
2024-12-03
  • Frank Winklmeier

    Seeing this false positive on aarch64 with cppcheck 2.16:

     double d = 1;
     printf("%i", int(d));
    
    test.cxx:5:3: warning: %i in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
      printf("%i", int(d));
      ^
    
     
  • CHR

    CHR - 2024-11-29

    Do you pass an explicit platform? The FP also happens with --platform=unix64-unsigned.

     
  • Oliver Stöneberg

     
  • Frank Winklmeier

    Thanks. No, I did not specify an explicit platform.

     

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.