context-independent macros
jim at ISM780B.UUCP
jim at ISM780B.UUCP
Fri Feb 8 16:08:25 AEST 1985
>So the solution is to write the macro to only use an expression:
>
> #define assert(x) ((x)? 0: complain ("x not true"))
>or
> #define assert(x) ((x) || complain ("x not true"))
>
>I think everybody will find the first form clearer except sh programmers. :-)
The first form gets "null effect" from lint, but the second form is just
right, and I myself will start using it immediately. Thanks.
-- Jim Balter, INTERACTIVE Systems (ima!jim)
More information about the Comp.lang.c
mailing list