Kaydet (Commit) b09acc30 authored tarafından Caolán McNamara's avatar Caolán McNamara

add a _attribute__((warn_unused_result)) based macro

üst 861f8ece
...@@ -296,6 +296,18 @@ typedef void * sal_Handle; ...@@ -296,6 +296,18 @@ typedef void * sal_Handle;
#define SAL_EXCEPTION_DLLPRIVATE #define SAL_EXCEPTION_DLLPRIVATE
#endif #endif
/** Use this as markup for functions and methods whose return value must be
checked.
Compilers that support a construct of this nature will emit a compile
time warning on unchecked return value.
*/
#if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
# define SAL_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define SAL_WARN_UNUSED_RESULT
#endif
/** Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ... /** Use this for pure virtual classes, e.g. class SAL_NO_VTABLE Foo { ...
This hinders the compiler from setting a generic vtable stating that This hinders the compiler from setting a generic vtable stating that
a pure virtual function was called and thus slightly reduces code size. a pure virtual function was called and thus slightly reduces code size.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment