Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!sri-spam!ames!styx!lll-lcc!well!msudoc!umich!jtr485 From: jtr485@umich.UUCP Newsgroups: comp.bugs.4bsd Subject: Re: C preprocessor question Message-ID: <55@umich.UUCP> Date: Fri, 30-Jan-87 10:46:11 EST Article-I.D.: umich.55 Posted: Fri Jan 30 10:46:11 1987 Date-Received: Tue, 3-Feb-87 20:42:34 EST References: <818@wjvax.wjvax.UUCP> Organization: EECS, University of Michigan Lines: 25 Keywords: preprocessor, UNIX, BSD In article <818@wjvax.wjvax.UUCP>, brett@wjvax.UUCP 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? > Brett Galloway What do you expect his to do? The #if is not going to evaluate the expression (((0) << 8) | (0)) The #if takes an expression defined (recursively) by: an is 1) an integer string or 2) ( | ) or 3) ( & ) and nothing else. The only test you could perform on GROUP would be #ifdef. --j.a.tainter