Skip to content

[ci] run include-what-you-use in CI #6284

Open
@jameslamb

Description

Summary

In early 2024, the R package was almost archived on CRAN because of a compiler warning from clang-18 resulting from an unnecessary #include <string>.

ref: #6264

This project should test running include-what-you-use (https://github.com/include-what-you-use/include-what-you-use) in CI to catch such things earlier.

Motivation

Removing unused includes in C/C++ code could have the following benefits:

  • smaller binary size
  • reduced risk of runtime failures caused by irrelevant ABI breakages
  • reducing build / linking times
  • reduced effort required to update to new C++ standards

Description

Consider adding that to the cpp_tests CI jobs, and maybe to the R-package CMake CI jobs.

Try reverting the change from #6265 and test if include-what-you-use would have caught it.

References

See the documentation at https://github.com/include-what-you-use/include-what-you-use?tab=readme-ov-file#using-with-cmake.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions