This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix libstdc++-v3/include/math.h:66:1 2: error: 'constexpr bool std::isnan(double)' conflicts with a previous declaration


On 04/02/16 23:11 +0100, Gerald Pfeifer wrote:
It seems to break older versions of FreeBSD that have GCC 4.2
as their system compiler.  (Those versions aren't actually all
that old, they are stuck with GCC 4.2 as the last version under
GPLv2.)

The version of GCC doesn't matter, it's whether libc declares those
functions or not.

I tested the change on modern versions of FreeBSD and DragonFly which
have the following so don't declare them:

/*
* Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and
* isinf() as functions taking double.  C99, and the subsequent POSIX revisions
* (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating
* point type.  If we are targeting SUSv2 and C99 or C11 (or C++11) then we
* expose the newer definition, assuming that the language spec takes
* precedence over the operating system interface spec.
*/
#if     __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999
#undef isinf
#undef isnan
int     isinf(double);
int     isnan(double);
#endif

I'll enable the configure test for all targets and check that it's OK
on these ones which definitely don't declare the obsolete functions.
It should also fix it on systems that do declare them.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]