Summary: Is this swap() macro correct?
Richard H. Gumpertz
rhg at cpsolv.CPS.COM
Thu Jan 25 01:32:32 AEST 1990
In article <790 at stealth.acf.nyu.edu> brnstnd at stealth.acf.nyu.edu (Dan Bernstein) writes:
>The second is a more general religious argument: Macros should feel like
>functions. As above, they should reference each argument exactly once;
>if an argument is modified, the macro should use a pointer to it instead;
>and so on.
If C only had inline functions, this would be all be so much simpler. The
compiler would be able to handle the side-effects issues automatically.
--
==========================================================================
| Richard H. Gumpertz rhg at CPS.COM (913) 642-1777 or (816) 891-3561 |
| Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 |
==========================================================================
More information about the Comp.lang.c
mailing list