Skip to content

Commit

Permalink
fixed error message for clang on MacOSX
Browse files Browse the repository at this point in the history
The error msg was:
_Pragma ("clang diagnostic ignored \"-Wnoexcept-type\"")

The version scheme for clang on MacOSX is different then for the other operating systems.
The version prior clang 9 on mac did not support this pragma. So we disable it.

thx to @gabyx
  • Loading branch information
acki-m committed Feb 2, 2018
1 parent 5843fa8 commit 41d1cb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rttr/detail/base/core_prerequisites.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,11 @@ namespace rttr
# define RTTR_BEGIN_DISABLE_CONDITIONAL_EXPR_WARNING
# define RTTR_END_DISABLE_CONDITIONAL_EXPR_WARNING

#if RTTR_COMP_VER >= 500

#if (RTTR_COMP_VER >= 500 && RTTR_PLATFORM != RTTR_PLATFORM_APPLE) ||
(RTTR_COMP_VER >= 900 && RTTR_PLATFORM == RTTR_PLATFORM_APPLE)

This comment has been minimized.

Copy link
@gabyx

gabyx Feb 2, 2018

Contributor

are you sure, this fixes that correctly?
because I used the following

#if (!defined(RTTR_COMP_VER_IS_APPLE_CLANG) && RTTR_COMP_VER >= 500 ) || \
    (defined(RTTR_COMP_VER_IS_APPLE_CLANG) && RTTR_COMP_VER >= 900) 

maybe you merge my branch to see.
Because RTTR_PLATFORM_APPLE is not meaning we are using AppleClang ;)
it just says we are on apple, (we can use gcc... or whatever)

This comment has been minimized.

Copy link
@gabyx

gabyx Feb 2, 2018

Contributor

Sorry: I mean we can have a clang compiler 6.0 on Apple platform, installer from llvm, which will not work in your solution.

# define RTTR_BEGIN_DISABLE_EXCEPT_TYPE_WARNING _Pragma ("clang diagnostic push") \
_Pragma ("clang diagnostic ignored \"-Wnoexcept-type\"")
# define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING _Pragma ("clang diagnostic pop")

#else
# define RTTR_BEGIN_DISABLE_EXCEPT_TYPE_WARNING
# define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING
Expand All @@ -303,7 +302,7 @@ namespace rttr
# define RTTR_END_DISABLE_EXCEPT_TYPE_WARNING

#else
# pragma message("WARNING: ukown compiler, don't know how to disable deprecated warnings")
# pragma message("WARNING: unknown compiler, don't know how to disable deprecated warnings")
#endif

} // end namespace rttr
Expand Down
1 change: 1 addition & 0 deletions src/rttr/detail/misc/standard_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <map>
#include <list>
#include <set>
#include <string>

// explicit instantiation of std::string needed, otherwise we get a linker error with clang on osx
// thats a bug in libc++, because of interaction with __attribute__ ((__visibility__("hidden"), __always_inline__)) in std::string
Expand Down

0 comments on commit 41d1cb8

Please sign in to comment.