Menu

Possible MISRA 5.9 false positive

2024-10-08
2024-12-24
  • Richard Smith

    Richard Smith - 2024-10-08

    Similar to my MISRA 8.7 comment we have what seem like 5.9 false positives.

    It's not clear to me why the addon thinks the identifiers are not unique. The function referenced appears to be declared static in all the cases where it is used.

    If I were to look into the .ctu-info files what I'm I looking for to find where it thinks the overlapping identifiers are.

     
  • Daniel Marjamäki

    I believe you can look at "MisraInternalIdentifiers"
    I guess that if the identifier is listed 2 or more times there will be a 5.9 warning.

     
  • Bob Cousins

    Bob Cousins - 2024-12-24

    I am also seeing this, there is only one declaration of the identifier.

     
  • Bob Cousins

    Bob Cousins - 2024-12-24

    I figured out why I was getting this error. cppcheck is analysing the same file twice, so presumably on the second time it thinks an identifier has already been defined.

    In my Paths setup I had paths of "." and "drivers", so all files in "drivers" were being scanned twice. I can see in files.txt that the files are listed twice, first time with an "a1" suffix and again with an "a2 suffix.

    Ideally cppcheck would recognise that source files have already been scanned, but a workaround is to ensure that files can only be found through once search path; check "files.txt" to verify that files have been scanned correctly. There should be only one entry for each file.

     

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.