From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gw.goop.org ([64.81.55.164]:53747 "EHLO mail.goop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753047AbYEXVOV (ORCPT ); Sat, 24 May 2008 17:14:21 -0400 Message-ID: <4838850E.20101@goop.org> Date: Sat, 24 May 2008 22:13:50 +0100 From: Jeremy Fitzhardinge MIME-Version: 1.0 Subject: Re: [RFC PATCH] kconfig: introduce KCONFIG_* symbols for .c files References: <20080524192540.GA28067@uranus.ravnborg.org> <48387F0B.3020506@goop.org> <48388187.2070503@goop.org> <20080524210304.GD2308@cs181133002.pp.htv.fi> In-Reply-To: <20080524210304.GD2308@cs181133002.pp.htv.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Adrian Bunk Cc: Sam Ravnborg , linux-kbuild , LKML , Linus Torvalds , Andrew Morton , Roman Zippel , Tom Spink Adrian Bunk wrote: > On Sat, May 24, 2008 at 09:58:47PM +0100, Jeremy Fitzhardinge wrote: > >> Would >> >> #define KCONFIG(x) (CONFIG_##x - 0) >> >> if (KCONFIG(PREEMPT)) { >> ... >> } >> >> work? >> > > $ cat test.c > #define KCONFIG(x) (CONFIG_##x - 0) > > int main() > { > if (KCONFIG(PREEMPT)) > ; > > return 0; > } > $ gcc -O2 -Wall test.c > test.c: In function ‘main’: > test.c:5: error: ‘CONFIG_PREEMPT’ undeclared (first use in this function) > test.c:5: error: (Each undeclared identifier is reported only once > test.c:5: error: for each function it appears in.) > You and your scientific method. Yeah, this is one of those cases where you need cpp to rescan its input after pasting, and I don't think it will ever do that. J