Menu

Possible false positive in MISRAC 20.7

2024-01-10
2024-01-10
  • Enrico Benso

    Enrico Benso - 2024-01-10

    Hello,

    in our code we are using the following macro:

    #define PROP_VARIABLE_DEFINE(NAME, TYPE, DEFAULT_VALUE)                            \
            static TYPE m##NAME = DEFAULT_VALUE;                                            \
            static const TYPE m##NAME##DEF = DEFAULT_VALUE;
    

    Cppcheck version 2.12.1 reports a MISRAC violation for the rule 20.7, but enclosing macro parameters inside parenthesis gives a compilation error.

    Thank you for your support

     
  • Daniel Marjamäki

    thanks! I have created this ticket: https://trac.cppcheck.net/ticket/12337

     

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.