OpenMP vs. <math.h>
Tue Jan 12 21:41:00 GMT 2010
Andy Koppe wrote:
> 2010/1/12 Yaakov (Cygwin/X)
>> But thinking about this further, there's just no way that these macros would ever be safe with C++.
> Yep, and the C++98 standard actually outlaws them, in Â§18.104.22.168 :
> Names that are defined as functions in C shall be defined as functions
> in the C++ Standard Library.*
> [Footnote: This disallows the practice, allowed in C, of providing
> a "masking macro" in addition to the function prototype. The only way
> to achieve equivalent "inline" behavior in C++ is to provide a
> definition as an extern inline function. --- end foonote]
Ah, that's clear. So yes, we should not emit any of these macros in C++ and
Yaakov's patch is correct. Thanks for digging that reference up.
More information about the Newlib