aboutsummaryrefslogtreecommitdiffstats
path: root/src/3rdparty/masm
diff options
context:
space:
mode:
authorFabian Kosmale <[email protected]>2021-11-01 14:31:49 +0100
committerFabian Kosmale <[email protected]>2021-11-02 11:34:25 +0100
commit6b4d3613326b38bc05c813c449b31affd9c3795a (patch)
tree82cd1cebcc464138ddff18d4c4fd88f7522b7cf9 /src/3rdparty/masm
parente7dff7b13a2ff1a50e26c9961808a6818cd7445e (diff)
Avoid -Wignored-attributes warning with clang
The WTF macro only really works for gcc, so do not enable it for clang. Clang expects the attribute to come before the function; however, as WTF is (originally) third-party code, we avoid extensive modifications. Task-number: QTBUG-91163 Change-Id: Ic555c6721d2c4232a7d7bd84d53cdf6ad6cea86b Reviewed-by: Andrei Golubev <[email protected]> Reviewed-by: Assam Boudjelthia <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
Diffstat (limited to 'src/3rdparty/masm')
-rw-r--r--src/3rdparty/masm/wtf/Assertions.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/3rdparty/masm/wtf/Assertions.h b/src/3rdparty/masm/wtf/Assertions.h
index bb0fef7ff0..d49354311d 100644
--- a/src/3rdparty/masm/wtf/Assertions.h
+++ b/src/3rdparty/masm/wtf/Assertions.h
@@ -116,7 +116,11 @@
/* WTF logging functions can process %@ in the format string to log a NSObject* but the printf format attribute
emits a warning when %@ is used in the format string. Until <rdar://problem/5195437> is resolved we can't include
the attribute when being used from Objective-C code in case it decides to use %@. */
-#if COMPILER(GCC) && !defined(__OBJC__)
+/* clang requires the attribute before the function (and pretends to be GCC), breaking the common
+ usage of the macro. Instead of modifying WTF code all over the place, simply disable the attribute
+ for clang.
+ */
+#if COMPILER(GCC) && !defined(__OBJC__) && !COMPILER(CLANG)
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments) __attribute__((__format__(printf, formatStringArgument, extraArguments)))
#else
#define WTF_ATTRIBUTE_PRINTF(formatStringArgument, extraArguments)