bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] Fix gnulib C++ namespace support and std::frexp


From: Pedro Alves
Subject: [PATCH] Fix gnulib C++ namespace support and std::frexp
Date: Sat, 12 Nov 2016 16:22:53 +0000

frexp is an overloaded function in C++.  Use _GL_CXXALIASWARN1 to
explicitly pick the overload being replaced.

Otherwise, with e.g. GCC 7, if you enable gnulib's namespace support,
you'll see:

  In file included from .../src/gdb/common/common-defs.h:54:0,
                   from .../src/gdb/defs.h:28,
                   from .../src/gdb/score-tdep.c:24:
  build-gnulib/import/math.h:1326:1: error: type of ‘std::frexp’ is unknown
   _GL_CXXALIASWARN (frexp);
   ^
  build-gnulib/import/math.h:1326:1: error: ‘int frexp’ redeclared as different 
kind of symbol
   _GL_CXXALIASWARN (frexp);
   ^
  In file included from /opt/gcc/include/c++/7.0.0/math.h:36:0,
                   from build-gnulib/import/math.h:27,
                   from .../src/gdb/score-tdep.h:26,
                   from .../src/gdb/score-tdep.c:38:
  /opt/gcc/include/c++/7.0.0/cmath:300:3: note: previous declaration ‘float 
std::frexp(float, int*)’
     frexp(float __x, int* __exp)
     ^~~~~

ChangeLog:
2016-11-12  Pedro Alves  <address@hidden>

        Fix gnulib C++ namespace support and std::frexp
        * lib/math.in.h (frexp): Use _GL_CXXALIASWARN1 instead of
        _GL_CXXALIASWARN.
---
 lib/math.in.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/math.in.h b/lib/math.in.h
index b7a0029..9a194cb 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -983,7 +983,7 @@ _GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
 # else
 _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
 # endif
-_GL_CXXALIASWARN (frexp);
+_GL_CXXALIASWARN1 (frexp, double, (double x, int *expptr));
 #elif defined GNULIB_POSIXCHECK
 # undef frexp
 /* Assume frexp is always declared.  */
-- 
2.5.5




reply via email to

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