SPSCQueue icon indicating copy to clipboard operation
SPSCQueue copied to clipboard

Mark as system includes unless building standalone

Open Krzmbrzl opened this issue 1 year ago • 4 comments

Marking as system headers prevents the compiler from emitting warnings from these headers.

Krzmbrzl avatar Jan 04 '24 14:01 Krzmbrzl

I think I would rather fix the warnings. What warnings did you encounter?

rigtorp avatar Jan 27 '24 18:01 rigtorp

This can be done additionally but new compilers will bring new warnings and even if you manage to fix all warnings in the upstream project, most folks will use a (slightly) older release and will still be affected by new warnings. Having third party dependencies potentially issue warnings in their header files essentially makes it impossible to use warnings as errors for own projects. That's why it's more or less?good practice to mark external depenency header files as system includes.

As for the exact warnings I was seeing, I'll have to check again 👀

Krzmbrzl avatar Jan 28 '24 07:01 Krzmbrzl

Catch2 also doesn't mark the includes as SYSTEM: https://github.com/catchorg/Catch2/blob/devel/src/CMakeLists.txt#L395

If you use ExternalProject you can patch there. If you vendor you can just modify the CMakeLists.txt.

rigtorp avatar Jan 31 '24 03:01 rigtorp

I already vendor because of this, but figured that others could profit from this as well if this was incorporated in the main project. And afaict there is no downside to doing this :shrug:

Krzmbrzl avatar Feb 01 '24 06:02 Krzmbrzl