Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!brl-adm!adm!moss@BRL.ARPA From: moss@BRL.ARPA Newsgroups: comp.lang.c Subject: Re: C preprocessor question Message-ID: <4136@brl-adm.ARPA> Date: Fri, 30-Jan-87 13:31:37 EST Article-I.D.: brl-adm.4136 Posted: Fri Jan 30 13:31:37 1987 Date-Received: Sat, 31-Jan-87 07:06:26 EST Sender: news@brl-adm.ARPA Lines: 25 Brett Galloway writes... >I have a question about the C preprocessor. I have the following code >fragment, which fails to compile on my system (4.2BSD): > >#define GROUP(group,subgroup) (((group) << 8) | (subgroup)) > >#if GROUP(0,0) >#endif > >The #if chokes for some reason. Can anyone in comp.lang.c see my error? >If there is no error, is this a known bug of the 4.2BSD cpp? The pre-processor defined macros are not evaluated by CPP. In other words, "#if GROUP(0,0)" is illegal because GROUP(0,0) has no value. You might want to use: if( GROUP(0,0) ) ... instead. Or, maybe you meant to say: #if defined( GROUP ) ... #endif -moss