cppcheck icon indicating copy to clipboard operation
cppcheck copied to clipboard

iwyu.yml: work around missing includes for Fedora [skip ci]

Open firewave opened this issue 6 months ago • 2 comments

firewave avatar Jun 25 '25 10:06 firewave

In file included from /__w/cppcheck/cppcheck/externals/tinyxml2/tinyxml2.cpp:24:
In file included from /__w/cppcheck/cppcheck/externals/tinyxml2/tinyxml2.h:38:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/15/../../../../include/c++/15/climits:47:
/usr/include/limits.h:124:16: fatal error: 'limits.h' file not found
  124 | # include_next <limits.h>
      | 

This issue will pop up when a distro updates its LLVM to a newer version than IWYU is built against.

firewave avatar Jun 25 '25 19:06 firewave

After the fix there is another issue when using libc++:

In file included from /__w/cppcheck/cppcheck/externals/tinyxml2/tinyxml2.cpp:31:
/usr/bin/../include/c++/v1/cstddef:45:5: error: <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header.           This usually means that your header search paths are not configured properly.           The header search paths should contain the C++ Standard Library headers before           any C Standard Library, and you are probably using compiler flags that make that           not be the case.
   45 | #   error <cstddef> tried including <stddef.h> but didn't find libc++'s <stddef.h> header. \
      |     ^

firewave avatar Jun 25 '25 20:06 firewave

After the fix there is another issue when using libc++:

I disabled that step for now...

firewave avatar Jun 29 '25 15:06 firewave

See https://github.com/danmar/cppcheck/actions/runs/15956527702/job/45003567477 for a successful build with the changes applied.

firewave avatar Jun 29 '25 15:06 firewave