From 4652559dd8abce3a041b875301cc776adaebff5d Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Mon, 16 Jan 2017 19:14:52 -0800 Subject: [PATCH] Bug 1333686 - Part 3: Fix -Wmacro-redefined warnings in ipc/chromium. r=jld The WARN_UNUSED_RESULT macro is defined in multiple Google header files in ipc/chromium and webrtc. Copy the WARN_UNUSED_RESULT definition from the latest security/sandbox/chromium/base/compiler_specific.h to our ipc/chromium code. Also remove the ALLOW_UNUSED macro definition because it is no longer defined in the latest compiler_specific.h and is not used anywhere. Warning: -Wmacro-redefined in ipc/chromium/src/base/compiler_specific.h: 'WARN_UNUSED_RESULT' macro redefined ipc/chromium/src/base/compiler_specific.h:73:9: warning: 'WARN_UNUSED_RESULT' macro redefined [-Wmacro-redefined] #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) media/webrtc/trunk/webrtc/typedefs.h:152:9: note: previous definition is here #define WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) MozReview-Commit-ID: EUIlXGKLhDL --HG-- extra : rebase_source : 4c584dfa2243514aef0357ff919d1cba48bd8b86 --- ipc/chromium/src/base/compiler_specific.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ipc/chromium/src/base/compiler_specific.h b/ipc/chromium/src/base/compiler_specific.h index 509dfa4b46e6..5f2632cabb51 100644 --- a/ipc/chromium/src/base/compiler_specific.h +++ b/ipc/chromium/src/base/compiler_specific.h @@ -67,12 +67,14 @@ #endif // COMPILER_MSVC - -#if defined(COMPILER_GCC) -#define ALLOW_UNUSED __attribute__((unused)) +// Annotate a function indicating the caller must examine the return value. +// Use like: +// int foo() WARN_UNUSED_RESULT; +// To explicitly ignore a result, see |ignore_result()| in base/macros.h. +#undef WARN_UNUSED_RESULT +#if defined(COMPILER_GCC) || defined(__clang__) #define WARN_UNUSED_RESULT __attribute__((warn_unused_result)) -#else // Not GCC -#define ALLOW_UNUSED +#else #define WARN_UNUSED_RESULT #endif