summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2013-07-23 09:49:57 +0200
committerLuboš Luňák <l.lunak@suse.cz>2013-07-23 09:52:11 +0200
commit92dfa82d2d25f2acdee0a538bf15f1fac36c0ecf (patch)
tree7054baae8356a17f7ae69ecd48cee9cd8aca4277 /include
parent0d2a7adf4e12b08bb6017df03e6e4ea04acc5df5 (diff)
adjust for upstreaming of warn_unused attribute
The warn_unused attribute has been upstream to GCC and Clang, so use it if present. Still warn about STL types if those do not use it yet (which is the status as of now). Change-Id: I3c003e44c08d1d141e23bba38cf92e663a5ac353
Diffstat (limited to 'include')
-rw-r--r--include/sal/types.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/sal/types.h b/include/sal/types.h
index 070a3f29474a..9ce2cef8aa19 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -551,13 +551,13 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
or external constructors or destructors. Classes marked with SAL_WARN_UNUSED
will be warned about.
- Currently implemented by a Clang compiler plugin.
-
@since LibreOffice 4.0
*/
-#if defined __clang__
+#if HAVE_GCC_ATTRIBUTE_WARN_UNUSED
+#define SAL_WARN_UNUSED __attribute__((warn_unused))
+#elif defined __clang__
#define SAL_WARN_UNUSED __attribute__((annotate("lo_warn_unused")))
#else
#define SAL_WARN_UNUSED