OpenMP vs. <math.h>
Dave Korn
dave.korn.cygwin@googlemail.com
Tue Jan 12 19:12:00 GMT 2010
[ meant to reply last week, but dropped the ball. sorry. ]
Yaakov (Cygwin/X) wrote:
> POSIX allows for <math.h> functions to also be defined as macros.
> Currently, only log2 and log2f are so defined.
>
> These macros pose problems with a few projects which define their own
> static/inline/template log2()
> However, I just encountered tonight a much larger conflict: OpenMP/C++
> and <math.h> are incompatible.
> As this would seem to affect all Newlib platforms, I think the most
> plausible solution is to make the log2 macros dependent on !__cplusplus.
> Patch attached.
Why is the solution to penalise all the correct and valid C++ code out there
instead of to fix the few buggy bits and pieces that don't conform to the
language standard?
cheers,
DaveK
More information about the Newlib
mailing list