Often, in addition to providing a function declaration, C standard headers may provide a \"masking macro\" to make things speedier. For example, if I include ctype.h<
From here: http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.dinkum_en_ecpp%2Flib_over.html
Arguments that have side effects evaluate the same way whether the expression executes the macro expansion or calls the function. Macros for the functions getc and putc are explicit exceptions to this rule.
I've found a few other references saying about the same thing (though nothing citing the C standard directly).
So it seems the limits are that only getc()
and putc()
may cause havoc in the way you foresee. Apart from those two, you should be safe, assuming your platform is at least one of sane or conforming.