On 22/03/16 15:42, Yaakov Selkowitz wrote:
We also had issues enabling C99-in-C++ on Cygwin (which is based on
newlib), which required a few patches:
https://github.com/cygwinports/gcc/blob/master/0023-glibcxx-use-c99.patch
https://github.com/cygwinports/gcc/blob/master/0026-g%2B%2B-gnu-source.patch
It is on my to-do list to get this working on newlib targets once we
have a snapshot with the new feature test macros.
Ok so I now know where the problem is coming from, its the fact that
_GLIBCXX98_USE_C99_MATH is defined based on the configure which uses
-std=g++98, whereas the test in libstdc++ uses -std=gnu++98. The first
ends up with a __ISO_C_VISIBLE 1990 the latter 1999 because
_POSIX_C_SOURCE is defined as 200809L for gnu++98 and undefined for c++98.
This was working before because the C99 functions would always be
included when compiling for c++ due to the || defined(__cplusplus),
adding this back would fix it, but I'm assuming you removed it for a
reason. I will look further into why this discrepancy in macros for
c++98 and gnu++98.