eranpeer / FakeIt

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

warning: unknown attribute 'optimize' ignored [-Wunknown-attributes] #238

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:5291:7: warning: unknown attribute 'optimize' ignored [-Wunknown-attributes]
    [[gnu::optimize("no-devirtualize")]]
      ^

This seems to be a GNU extension. I would expect CMake (or the preprocessor) to find out which compiler I am using and only use those attributes that are supported.

FranckRJ commented 3 years ago

Should be fixed on 2.0.8, which version are you using ?

Le jeu. 15 avr. 2021 à 09:20, Niels Lohmann @.***> a écrit :

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

../external/fakeit/fakeit.hpp:5291:7: warning: unknown attribute 'optimize' ignored [-Wunknown-attributes] [[gnu::optimize("no-devirtualize")]] ^

This seems to be a GNU extension. I would expect CMake (or the preprocessor) to find out which compiler I am using and only use those attributes that are supported.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eranpeer/FakeIt/issues/238, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABX5ET57PMAVSDJXWK5A2FDTI2HSRANCNFSM42633JMA .

nlohmann commented 3 years ago

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