eranpeer / FakeIt

C++ mocking made easy. A simple yet very expressive, headers only library for c++ mocking.
MIT License
1.22k stars 169 forks source link

warning: unknown warning group '-Wcast-function-type', ignored [-Wunknown-warning-option] #239

Closed nlohmann closed 3 years ago

nlohmann commented 3 years ago

With Clang (Apple clang version 12.0.0 (clang-1200.0.32.29)), I get the following warning compiling FakeIt:

../external/fakeit/fakeit.hpp:5314:32: warning: unknown warning group '-Wcast-function-type', ignored [-Wunknown-warning-option]
#pragma GCC diagnostic ignored "-Wcast-function-type"
                               ^

Clang seems to not know the flag -Wcast-function-type. I would expect CMake (or the preprocessor) to find out which compiler I am using and only use those flags that are supported.

nlohmann commented 3 years ago

Related: https://github.com/eranpeer/FakeIt/issues/238

nlohmann commented 3 years ago

The warning is gone with version 2.0.8. Sorry for not trying this earlier.