I can't see anything wrong with the C code and nor can gcc or clang. I am using the Macports installation of cppcheck version 2.7 and the command line was:
cppcheck t.c
Using --clang provides a work-around, but I am mainly interested in the MISRA add-on and that doesn't seem to work with --clang.
I appreciate that the example is fairly silly C, but I am writing test cases and want some obscure examples of type introduction.
The following 4 line example gives an error on line 4:
as follows
I can't see anything wrong with the C code and nor can gcc or clang. I am using the Macports installation of cppcheck version 2.7 and the command line was:
Using --clang provides a work-around, but I am mainly interested in the MISRA add-on and that doesn't seem to work with --clang.
I appreciate that the example is fairly silly C, but I am writing test cases and want some obscure examples of type introduction.
The code is attached.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/11001