User Activity

  • Posted a comment on discussion Development on cppcheck

    I updated the test code as below, it report 5.5 violation in both -DERRTEST and -UERRTEST cases. #ifdef ERRTEST #define testmacro(x) read(x) #endif struct teststruct { int testmacro; }; for the "regardless of whether the definition is still in force when the identifier is declared", I guess it's for the case add "#undef" before identifier? because it said "STILL in force". In -UERRTEST case here, the macro is never in "in force" status.

  • Posted a comment on discussion Development on cppcheck

    test code: #ifdef ERRTEST #define testmacro read #endif struct teststruct { int testmacro; }; From logic, it should report 5.5 error when ERRTEST is defined. And no error when ERRTEST is not defined. The real test result is it report error when ERRTEST not defined, but it's ok when ERRTEST is defined. $ cppcheck --addon=misra -UERRTEST --cppcheck-build-dir=out test.c Checking test.c ... test.c:7:6: style: Identifiers shall be distinct from macro names (Required) [misra-c2012-5.5] int testmacro; ^...

View All

Personal Data

Username:
bhe39
Joined:
2021-11-02 23:50:49

Projects

  • No projects to display.

Personal Tools