From e93c40b33d344d7d8bc4bef7a3038f7e60a6f216 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 4 Nov 2018 13:59:15 +0100 Subject: [PATCH] tests: don't disable C++ warnings in C files This triggers error with GCC. See eff6739124c61bb5660d78453210d1d6a17d30e7. * tests/testsuite.h: Disable -Wzero-as-null-pointer-constant only for C++. --- tests/testsuite.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testsuite.h b/tests/testsuite.h index 7e8e0599..e4c8298d 100644 --- a/tests/testsuite.h +++ b/tests/testsuite.h @@ -7,7 +7,7 @@ /* In C++ pre C++11 it is standard practice to use 0 for the null pointer. But GCC -std=c++98 with -Wzero-as-null-pointer-constant warns about this. Warning introduced in GCC 4.7. */ -#if !defined __cplusplus || __cplusplus < 201103L +#if defined __cplusplus && __cplusplus < 201103L # if defined __GNUC__ && ! defined __clang__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ # pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" # endif