From 6e6144b33f415855cc780b23ef8baeca767e56a1 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Tue, 15 Nov 2022 15:49:04 +0100 Subject: [Backport] GCC: disable unsupported annotate attribute Creates a lot of noise in non-official builds. Bug: 819294 Change-Id: I900c588625751b4f82c52e1306c487a822d8e8d8 Review-URL: https://chromium-review.googlesource.com/c/chromium/src/+/3941629 Cr-Commit-Position: refs/heads/main@{#1057012} Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/443566 Reviewed-by: Allan Sandfeld Jensen --- chromium/base/memory/raw_ptr_exclusion.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/chromium/base/memory/raw_ptr_exclusion.h b/chromium/base/memory/raw_ptr_exclusion.h index 37e9eac49cd..2cfaefc52e0 100644 --- a/chromium/base/memory/raw_ptr_exclusion.h +++ b/chromium/base/memory/raw_ptr_exclusion.h @@ -6,7 +6,9 @@ #define BASE_MEMORY_RAW_PTR_EXCLUSION_H_ #include "build/build_config.h" +#include "base/compiler_specific.h" +#if HAS_ATTRIBUTE(annotate) #if defined(OFFICIAL_BUILD) // The annotation changed compiler output and increased binary size so disable // for official builds. @@ -17,5 +19,8 @@ // Example: RAW_PTR_EXCLUSION Foo* foo_; #define RAW_PTR_EXCLUSION __attribute__((annotate("raw_ptr_exclusion"))) #endif +#else +#define RAW_PTR_EXCLUSION +#endif #endif // BASE_MEMORY_RAW_PTR_EXCLUSION_H_ -- cgit v1.2.1