From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753039AbcE2Sx6 (ORCPT ); Sun, 29 May 2016 14:53:58 -0400 Received: from science.sciencehorizons.net ([71.41.210.147]:55774 "HELO ns.sciencehorizons.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with SMTP id S1752811AbcE2Sx5 (ORCPT ); Sun, 29 May 2016 14:53:57 -0400 Date: 29 May 2016 14:53:55 -0400 Message-ID: <20160529185355.12968.qmail@ns.sciencehorizons.net> From: "George Spelvin" To: geert@linux-m68k.org, linux@sciencehorizons.net, torvalds@linux-foundation.org Subject: Re: [PATCH 2/2] test/hash: Fix warning in preprocessor symbol evaluation Cc: linux-kernel@vger.kernel.org In-Reply-To: <1464542922-7139-2-git-send-email-geert@linux-m68k.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Geert Uytterhoeven wrote: > Some versions of gcc don't like tests for the value of an undefined > preprocessor symbol, even in the #else branch of an #ifndef: Damn, I had hoped that would work universally; I tried to avoid the uglier #if-inside-#ifdef construction. GCC 6 is quite happy wth it. But no objections. If you want: Acked-by: George Spelvin But here's an alternative. Geert, what do you think of this? diff --git a/lib/test_hash.c b/lib/test_hash.c index c9549c8b..8ea1d2ca 100644 --- a/lib/test_hash.c +++ b/lib/test_hash.c @@ -221,17 +221,17 @@ test_hash_init(void) /* Issue notices about skipped tests. */ #ifndef HAVE_ARCH__HASH_32 pr_info("__hash_32() has no arch implementation to test."); -#elif HAVE_ARCH__HASH_32 != 1 +#elif HAVE_ARCH__HASH_32 + 0 != 1 pr_info("__hash_32() is arch-specific; not compared to generic."); #endif #ifndef HAVE_ARCH_HASH_32 pr_info("hash_32() has no arch implementation to test."); -#elif HAVE_ARCH_HASH_32 != 1 +#elif HAVE_ARCH_HASH_32 + 0 != 1 pr_info("hash_32() is arch-specific; not compared to generic."); #endif #ifndef HAVE_ARCH_HASH_64 pr_info("hash_64() has no arch implementation to test."); -#elif HAVE_ARCH_HASH_64 != 1 +#elif HAVE_ARCH_HASH_64 + 0 != 1 pr_info("hash_64() is arch-specific; not compared to generic."); #endif