summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-04-02 21:06:32 -0700
committerArseny Kapoulkine <arseny.kapoulkine@gmail.com>2018-04-02 21:06:32 -0700
commit4f9af798501b3fb0d930d0914f0b50042dccbcc1 (patch)
tree272160740130e4f020ce528aa57bf96ecb3bb7ac /src
parentcb0e8937da3afede98e7aea108e33e33d4cb64ef (diff)
Work around gcc-8 warning
gcc-8 produces "attribute directive ignored" warning for no_sanitize("unsigned-integer-overflow"); at some point gcc will introduce integer sanitizer support and we'll have to do this all over again but for now just don't emit the attribute.
Diffstat (limited to 'src')
-rw-r--r--src/pugixml.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index d140425..0b9651a 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -106,8 +106,8 @@
# define PUGI__DMC_VOLATILE
#endif
-// Integer sanitizer workaround
-#ifdef __has_attribute
+// Integer sanitizer workaround; we only apply this for clang since gcc8 has no_sanitize but not unsigned-integer-overflow and produces "attribute directive ignored" warnings
+#if defined(__clang__) && defined(__has_attribute)
# if __has_attribute(no_sanitize)
# define PUGI__UNSIGNED_OVERFLOW __attribute__((no_sanitize("unsigned-integer-overflow")))
# else