From e2b0721c33d0df57c6a596b18ae98644575c51f9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 21 Feb 2023 11:10:00 +0100 Subject: Don't mis-apply GCC < 4.6 workaround for Clang ...which happens to define __GNUC__=4, __GNUC_MINOR__=2. (See also "external/cppunit: Don't mis-apply GCC < 4.6 workaround for Clang". This change requires "Use snprintf instead of sprintf" to avoid deprecation warnings on macOS, which had originally been hidden by the mis-applied #pragma.) Change-Id: I4fcb38a79766238862795ba4019638862e65b041 Reviewed-on: https://gerrit.libreoffice.org/c/cppunit/+/147384 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard --- include/cppunit/TestAssert.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cppunit/TestAssert.h b/include/cppunit/TestAssert.h index 19a8ae5..de97f21 100644 --- a/include/cppunit/TestAssert.h +++ b/include/cppunit/TestAssert.h @@ -11,7 +11,8 @@ // Work around "passing 'T' chooses 'int' over 'unsigned int'" warnings when T // is an enum type: -#if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) +#if defined __GNUC__ && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)) \ + && !defined __clang__ #pragma GCC system_header #endif -- cgit v1.2.3