Due to lines 1346-1347 in cppcheck.cpp: if (addon != "misra" && !addonInfo.ctu && endsWith(files.back(), ".ctu-info")) continue;
Running cppcheck with the option --addon=misra vs --addon=misra.py yields different results. They should not.
The example in the manual used the option --addon=misra.py. What is the prefered way to call and addon?
Per A.
PS! simple example: Using 'misra' give 2 violations, using 'misra.py' gives 1 violation $: ~ /tmp/misra-test> cppcheck --addon=misra interrupts.c Checking interrupts.c ... Checking interrupts.c: __DEBUG;__DEBUG_D;__XC32... interrupts.c:67:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.4] extern void Dummy_Handler(void); ^ interrupts.c:64:17: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.7] extern uint32_t _stack; ^</file></file>
$: ~/tmp/misra-test> cppcheck --addon=misra.py interrupts.c Checking interrupts.c ... Checking interrupts.c: __DEBUG;__DEBUG_D;__XC32... interrupts.c:67:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.4] extern void Dummy_Handler(void); ^</file>
hmm.. the intention was that you would get the same results.
but I would suggest that you create a misra.json and execute that. So you can provide a rule text file.
I have created this ticket: https://trac.cppcheck.net/ticket/10626
Log in to post a comment.
Due to lines 1346-1347 in cppcheck.cpp:
if (addon != "misra" && !addonInfo.ctu && endsWith(files.back(), ".ctu-info"))
continue;
Running cppcheck with the option --addon=misra vs --addon=misra.py yields different results.
They should not.
The example in the manual used the option --addon=misra.py.
What is the prefered way to call and addon?
Per A.
PS! simple example:
Using 'misra' give 2 violations, using 'misra.py' gives 1 violation
$: ~ /tmp/misra-test> cppcheck --addon=misra interrupts.c
Checking interrupts.c ...
Checking interrupts.c: __DEBUG;__DEBUG_D;__XC32...
interrupts.c:67:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.4]
extern void Dummy_Handler(void);
^
interrupts.c:64:17: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.7]
extern uint32_t _stack;
^</file></file>
$: ~/tmp/misra-test> cppcheck --addon=misra.py interrupts.c
Checking interrupts.c ...
Checking interrupts.c: __DEBUG;__DEBUG_D;__XC32...
interrupts.c:67:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-8.4]
extern void Dummy_Handler(void);
^</file>
Last edit: Per Arnold Blaasmo 2021-11-25
hmm.. the intention was that you would get the same results.
but I would suggest that you create a misra.json and execute that. So you can provide a rule text file.
I have created this ticket: https://trac.cppcheck.net/ticket/10626