Skip to content

Commit

Permalink
Merge pull request #243 from eranpeer/fix-gcc7-warning-unknown-opt
Browse files Browse the repository at this point in the history
Disable some GCC warnings only when available (GCC >= 8).
  • Loading branch information
FranckRJ committed May 10, 2021
2 parents 236ab10 + 6f8ece8 commit e29aafc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions include/mockutils/VTUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,18 @@ namespace fakeit {
class VTUtils {
public:

#ifdef __GNUG__
#ifndef __clang__
#if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 8
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-function-type"
#endif
#endif
template<typename C, typename R, typename ... arglist>
static unsigned int getOffset(R (C::*vMethod)(arglist...)) {
auto sMethod = reinterpret_cast<unsigned int (VirtualOffsetSelector::*)(int)>(vMethod);
VirtualOffsetSelector offsetSelctor;
return (offsetSelctor.*sMethod)(0);
}
#ifdef __GNUG__
#ifndef __clang__
#if defined(__GNUG__) && !defined(__clang__) && __GNUC__ >= 8
#pragma GCC diagnostic pop
#endif
#endif

template<typename C>
Expand Down

0 comments on commit e29aafc

Please sign in to comment.