[Cfp-interest] exceptional macro
David Hough CFP
pcfp at oakapple.net
Tue May 20 14:24:50 PDT 2014
> I=92m worrying about use of compound statements as a macro argument. =
> There=92s a discussion about this at
>
http://stackoverflow.com/questions/17182877/is-it-ok-to-use-a-code-block-as-an-argument-for-a-c-macro
> How serious is the restriction on the use of unguarded commas? E.g., how =
> would multidimensional arrays be expressed? Are there other =
> restrictions?
I think that's an interesting issue. Certainly multidimensional arrays
could be handled obliquely with pointers, as C programmers tend to do
anyway.
However the larger issue I gleaned from the web discussion is the
undebuggability of heavy-macro code. I'm more concerned about that.
However, I believe most FP_EXCEPTIONAL arguments
will be fairly simple expressions.
But considering the case of large compound statements, I think we need
#pragma declarations for exceptions as well as the macro. The #pragma
declarations should avoid scope issues by avoiding labels and local
variables... I'll think some more about that.
More information about the Cfp-interest
mailing list