[Cfp-interest] tgmath and macro suppression

Joel C. Salomon joelcsalomon at gmail.com
Thu Mar 22 17:09:14 PDT 2012


Jim Thomas <jaswthomas at sbcglobal.net> wrote:
> C11 doesn’t say what effect macro suppression has on the non-double
> functions invoked by tgmath. I think macro suppression should happen if and
> only if the program suppresses macro replacement for the function.

If that were the case, this would be cause for a rather severe defect
report, given that <tgmath.h> is supposed to be implementable by mans
of the _Generic keyword.

E.g., ignoring long doubles, within <tgmath.h> exp() will be defined
something like this:
    #define exp(x) _Generic((x), float:expf, default:exp)(x)
—which definitely suppresses macro expansion of expf().

—Joel



More information about the Cfp-interest mailing list