This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: OpenMP vs. <math.h>
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 Â17.4.1.2 :
>
> 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.
cheers,
DaveK