I think that it is better to avoid adding any configuration-time checks or target-specific COMPILE_FLAGS. The cmake configuration step is already taking way too long, and it is executed in a single thread. On my system, the configuration step takes roughly as much time as the rest of the compilation!
I tested the following in various compilers on https://godbolt.org, and I believe that Apple proprietary fork of clang should be fine with it as well.
#ifdef __GNUC__
|
# pragma GCC diagnostic ignored "-Wpragmas" /* silence GCC about the following */
|
# pragma GCC diagnostic ignored "-Wunknown-warning-option" /* silence clang */
|
# pragma GCC diagnostic ignored "-Wunused-but-set-variable"
|
#endif
|
The only relevant compiler that would issue warnings for the above would be icc older than 16.0, but I do not think that we should care about very old versions of nonstandard compilers. The oldest clang that does not issue any warnings about the above is version 3.5.
The patch for review is pushed to the branch bb-10.4-
MDEV-31890