Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ncoast.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!zehntel!dual!amd!decwrl!decvax!cwruecmp!atvax!ncoast!bsafw
From: bsafw@ncoast.UUCP (The WITNESS)
Newsgroups: net.lang.c
Subject: Re: expressions and #if
Message-ID: <209@ncoast.UUCP>
Date: Mon, 30-Jul-84 10:31:51 EDT
Article-I.D.: ncoast.209
Posted: Mon Jul 30 10:31:51 1984
Date-Received: Sat, 4-Aug-84 01:31:31 EDT
References: <2104@rlgvax.UUCP>, <319@harvard.ARPA> <165@tellab2.UUCP>
Organization: North Coast XENIX, Cleveland
Lines: 27

> How about using the cpp #ifdef this way:
> 
> #ifdef	FEATURE
>	if (not_otherwise_indicated())
> #endif	FEATURE
> 		{
> 		process ();
> 		...
> 		}
> 
> To me it is just as clear (maybe even a little more) than saying:
> 
>	if (FEATURE == disabled || not_otherwise_indicated()) {
>		process ();
>		...
>		}
>

But not_otherwise_indicated() will be executed in the second version, and
I've seen a LOT of code that uses side-effects... in which case the second
version may do something disastrous.  If not_otherwise_indicated() is just
a simple Boolean test, however, it'll work (if not as fast as it might).
-- 
		Brandon Allbery: decvax!cwruecmp{!atvax}!bsafw
		  6504 Chestnut Road, Independence, OH 44131

		  Witness, n.  To watch and learn, joyously.