Compiler warning pollution from dependencies
I tried for my dune module to really go hard on fix warnings from clang.
The output is polluted by giving warnings on all other included modules/header from e.g. dune-functions,yasp_grid,dune-geometry,...
.
Now I read about the fact that the compilers may not produce warning for system headers. https://cmake.org/cmake/help/latest/command/target_include_directories.html
If SYSTEM is specified, the compiler will be told the directories are meant as system include directories on some platforms. This may have effects such as suppressing warnings or skipping the contained headers in dependency calculations (see compiler documentation). Additionally, system include directories are searched after normal include directories regardless of the order specified.
Therefore, in https://gitlab.dune-project.org/core/dune-common/-/blob/1437ba8a2840120ef48d563f798134cbb66db70c/cmake/modules/DuneEnableAllPackages.cmake#L301, there could be an option to include these as SYSTEM header or even as default?
I'm not sure if this will break. Maybe there is another mechanism less intrusive I'm unaware of. Nevertheless, this is a show stopper for me to enable warning, since currently the warning pollution of dependencies is too big.
Any thoughts on this @simon.praetorius @santiago.ospina ? Thanks!