The analysis of the test.c is essentially skipped because there is #error. I believe this is a usability problem more or less.
Normally we just want to skip configurations that lead to an #error.. we do not want to set the error exitcode and we do not want to check those configurations..
If all configurations that are checked have an #error then maybe it would make sense to write some information message that cppcheck fails to analyze the file. Setting the error exitcode also sounds reasonable..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Let check this test.c:
... nice. But suddenly
Applies to version 2.3, current git (2020-12-28 b94a6d595), debian 10 on x64.
I do not have bugtracker account, so report this here.
Thanks! I have created ticket https://trac.cppcheck.net/ticket/10132
The analysis of the test.c is essentially skipped because there is #error. I believe this is a usability problem more or less.
Normally we just want to skip configurations that lead to an #error.. we do not want to set the error exitcode and we do not want to check those configurations..
If all configurations that are checked have an #error then maybe it would make sense to write some information message that cppcheck fails to analyze the file. Setting the error exitcode also sounds reasonable..