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

Spewing of "unknown pragma" warnings on MSVC #230

Closed helmesjo closed 3 years ago

helmesjo commented 3 years ago

It appears one of the more recent changes cause this to be spewed all over the MSVC build (probably from this PR). See the latest build.

c:\projects\fakeit\include\mockutils\union_cast.hpp(12): warning C5030: attribute 'gnu::optimize' is not recognized [C:\projects\fakeit\tests\all_tests.vcxproj]
c:\projects\fakeit\include\mockutils\vtutils.hpp(25): warning C4068: unknown pragma [C:\projects\fakeit\tests\all_tests.vcxproj]
c:\projects\fakeit\include\mockutils\vtutils.hpp(26): warning C4068: unknown pragma [C:\projects\fakeit\tests\all_tests.vcxproj]
c:\projects\fakeit\include\mockutils\vtutils.hpp(33): warning C4068: unknown pragma [C:\projects\fakeit\tests\all_tests.vcxproj]
FranckRJ commented 3 years ago

Yes, I will maybe look at it but I think it's good practice to lower / remove external headers warnings anyway : https://devblogs.microsoft.com/cppblog/broken-warnings-theory/

It's what GCC / clang do with -Isystem, so you will have a consistent behavior across compilers.

helmesjo commented 3 years ago

Yeah that's what I usually opt for (and did in this case), but thanks for the interesting read!