On 3aug2025 preprocessor and simplecpp got updated, and after this update cppcheck is failing to analyze real projects.
In cppcheck/test I added color.h, and that was enough to trigger the problem.
color.h includes fixture.h and fixture.h includes color.h again.
This is perfectly ok in regular c-code. And the preprocessor of the c-compiler we give a helping hand to protect itself with the #ifndef/#define or #pragma once. And before the update, cppcheck also did not have issues with circular includes.
On 3aug2025 preprocessor and simplecpp got updated, and after this update cppcheck is failing to analyze real projects.
In cppcheck/test I added color.h, and that was enough to trigger the problem.
color.h includes fixture.h and fixture.h includes color.h again.
This is perfectly ok in regular c-code. And the preprocessor of the c-compiler we give a helping hand to protect itself with the #ifndef/#define or #pragma once. And before the update, cppcheck also did not have issues with circular includes.
I have no idea where to start to solve this issue. So I hope there is someone smarter then me that knows how to fix the issue.
I can say that when I take the last version, and replace simplecpp and preprocessor files with the version of 2aug2025, the issue is gone.
Issue seems to be fixed now
Fix #14086 (simplecpp: Update to 1.5.2) (#7762)
https://github.com/danmar/simplecpp/blob/master/simplecpp.cpp
Fix infinite loop with circular includes (#497)
Last edit: Peter Schops 2025-08-21