From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753171AbcE2THP (ORCPT ); Sun, 29 May 2016 15:07:15 -0400 Received: from science.sciencehorizons.net ([71.41.210.147]:19406 "HELO ns.sciencehorizons.net" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with SMTP id S1752924AbcE2THN (ORCPT ); Sun, 29 May 2016 15:07:13 -0400 Date: 29 May 2016 15:07:12 -0400 Message-ID: <20160529190712.14364.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: <20160529185355.12968.qmail@ns.sciencehorizons.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > But here's an alternative. Geert, what do you think of this? Never mind; that doesn't work. Plain gcc-4.9 passes, it, but it's the "-Wundef" flag that the kernel uses that triggers it. So we're back to Geert's original suggestion. Acked-by: George Spelvin ==>$ cat foo.c #ifndef FOO This is a test. #elif FOO == 1 This is another test #elif FOO + 0 == 1 who knows #endif ==>$ gcc-6 -W -Wall -Wundef -E foo.c # 1 "foo.c" # 1 "" # 1 "" # 31 "" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 32 "" 2 # 1 "foo.c" This is a test. ==>$ gcc-4.9 -W -Wall -Wundef -E foo.c # 1 "foo.c" # 1 "" # 1 "" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "" 2 # 1 "foo.c" foo.c:3:7: warning: "FOO" is not defined [-Wundef] #elif FOO == 1 ^ foo.c:5:7: warning: "FOO" is not defined [-Wundef] #elif FOO + 0 == 1 ^ This is a test.