2012-11-09

Side with effete.

More of "I know C better than you!" stuff.

I just discovered (the verb is deeply characteristic) how to write a HAS_SIDE_EFFECTS(expr) macro that
  • doesn't evaluate expr and
  • returns true iff expr has side-effects.
The macro essentially depends on a GCC extension. It is useful, for example, as a sanity check in conditionally compiled code, e.g., in assert(expr).

No comments:

Post a Comment