long al = 1L; // warns long fl = 1L; // warns long gl = 1L; // ok! long abcdefl = 1L; // warn long abcdefgl = 1L; // ok!
Hi It seems that the plist output is incorrect since all diagnostics are mapped to file 0, which is clearly not correct. It can be reproduced using the simple example below: header.h: #ifndef HEADER_H #define HEADER_H static int aaa, bbb; #endif // HEADER_H main.c: #include "header.h" int main(void) { return 0; } $ cppcheck --enable=all --plist-output=./ --addon=misra --xml . <?xml version="1.0" encoding="UTF-8"?> <results version="2"> <cppcheck version="2.11"/> <errors> Checking main.c ... <error...
Hi! If a function argument is an array and it is declared using pointer notation (int *arr) then the out of bounds check works, but if declared using array notation (int arr[]) then there is no out of bounds warning, see the example below: void func1a(char *str); void func2a(char str[]); void func1b(char *str); void func2b(char str[]); int main(void) { char str_sized[2] = "A"; func1a(str_sized); func2a(str_sized); char str_unsized[] = "AB"; func1b(str_unsized); func2b(str_unsized); return 0; } void...
Hi! Is there a way to change the severity from 'style' for the errors found by the misra.py addon? I have integrated cppcheck with misra in our cmake build environment so that it runs for every file that compiles, but unfortunately the severity reported by misra errors is 'style' which the error-parser doesn't recognize.