summaryrefslogtreecommitdiff
path: root/lib/interception/interception.h
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2012-08-02 11:19:13 +0000
committerAlexey Samsonov <samsonov@google.com>2012-08-02 11:19:13 +0000
commit592d3f707e02968c75fd6e90d06d24f5df99c8b9 (patch)
tree9d8bfb9cf12e0cfb273ae50b44451b98023ea7b9 /lib/interception/interception.h
parent37b3fcd6fdec5740fe51fc1315c5d4d54313de98 (diff)
[Sanitizer] Workaround for a compiler warning - ISO C++ forbids casting pointer-to-function to pointer-to-object, so we use cast via integral type
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/interception/interception.h')
-rw-r--r--lib/interception/interception.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/interception/interception.h b/lib/interception/interception.h
index b72bff2a6..d05052370 100644
--- a/lib/interception/interception.h
+++ b/lib/interception/interception.h
@@ -148,6 +148,15 @@
INTERCEPTOR_EX(ret_type, __stdcall, func, __VA_ARGS__)
#endif
+// ISO C++ forbids casting between pointer-to-function and pointer-to-object,
+// so we use casting via an integral type __interception::uptr,
+// assuming that system is POSIX-compliant. Using other hacks seem
+// challenging, as we don't even pass function type to
+// INTERCEPT_FUNCTION macro, only its name.
+namespace __interception {
+typedef unsigned long uptr; // NOLINT
+} // namespace __interception
+
#define INCLUDED_FROM_INTERCEPTION_LIB
#if defined(__linux__)