expressions and #if

Marcus Hall thoth at tellab2.UUCP
Wed Jul 25 04:40:45 AEST 1984


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 ();
		...
		}

Plus, it is more obvious that the test is optionally compiled.  I know that
  this does get into some heavy problems when there are lots of #ifs around
  in a file, so if there are lots of them it does present a problem.

My objection to the later form is that I keep trying to relate the expression
   'FEATURE == disabled' to the execution of the code, not to the execution
   of the test.

marcus
..!ihnp4!tellab1!tellab2!thoth



More information about the Comp.lang.c mailing list