octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Major issues with g++ 6 and gnulib


From: Orion Poplawski
Subject: Re: Major issues with g++ 6 and gnulib
Date: Sat, 20 Feb 2016 08:34:47 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0

On 02/19/2016 04:33 PM, Orion Poplawski wrote:
Fedora Rawhide is running with gcc 6 now. The fist issue I hit was with signbit:

https://savannah.gnu.org/bugs/?47073

I think I have a workaround for that, but next I got:

array/Range.cc: In function 'double tfloor(double, double)':
array/Range.cc:498:21: error: 'floor' is not a member of 'gnulib'
    double t1 = 1.0 + gnulib::floor (x);
                      ^~~~~~
I believe this is because as of 6.0.0, /usr/include/c++/6.0.0/cmath does:

#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include_next <math.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS

which appears to have the effect of forcing it to include /usr/include/math.h
instead of the math.h from gnulib, which I expect is how gnulib worked with
C++ before.  This is true for the other C++ headers as well, e.g. cstdlib:


// Need to ensure this finds the C library's <stdlib.h> not a libstdc++
// wrapper that might already be installed later in the include search path.
#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#include_next <stdlib.h>
#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS


octave's lo-math.h does:

#if defined (__cplusplus)
#include <cmath>
// if #undef log2 is missing in cmath, undef it here
#if defined (log2)
#undef log2
#endif
#else
#include <math.h>
#endif

So it appears that gnulib's math.h will simply no longer be used.

I seem to be able to work around it at the moment by explicitly including
<math.h> before <cmath>, although I still haven't managed to get octave to
compile yet.  But I expect a better solution will need to be found for a
permanent fix.


Some comments from fedora-devel and a patch - https://lists.fedoraproject.org/archives/list/address@hidden/message/UY3VX3W7XEXYTUKHG5BALU4ACUD7ZLGE/

--
Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  address@hidden
Boulder, CO 80301              http://www.cora.nwra.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]