[error] disable error checking enforcement for old versions of clang (#4932)

With clang older than 3.9, the warn_unused_result feature works only
with functions and classes, not enums. This disables it if the clang
version is too old.
This commit is contained in:
Moandor
2020-05-07 10:36:06 -07:00
committed by GitHub
parent f411a412be
commit 60aa241594
+1 -1
View File
@@ -75,7 +75,7 @@ extern "C" {
* '-Wno-unused-result' compiler option.
*
*/
#if defined(__clang__)
#if defined(__clang__) && (__clang_major__ >= 4 || (__clang_major__ >= 3 && __clang_minor__ >= 9))
#define OT_MUST_USE_RESULT __attribute__((warn_unused_result))
#else
#define OT_MUST_USE_RESULT