groff
[Top][All Lists]
Advanced

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

Re: [groff] 1.22.4.rc4 - Final RC before official 1.22.4


From: Bertrand Garrigues
Subject: Re: [groff] 1.22.4.rc4 - Final RC before official 1.22.4
Date: Sat, 08 Dec 2018 01:07:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hi Ingo,

On Fri, Nov 30 2018 at 05:33:11 PM, Ingo Schwarze <address@hidden> wrote:
> What is potentially more serious is that "make" dies like this:
>
>   CXX      src/libs/libgroff/libgroff_a-hypot.o
> ../src/libs/libgroff/hypot.cpp:24:30: error: ‘double hypot(double, double)’ 
> conflicts with a previous declaration
>    double hypot(double, double);
[...]
> as far as i understand, there is a conflict between
> src/libs/libgroff/hypot.cpp and the system <math.h>, likely caused by
> NEED_DECLARATION_HYPOT being set even though it shouldn't.
>
> I see this in ../configure output:
>
>   checking whether hypot must be declared... yes
[...]
>
> The message "overloaded function with no contextual type information" is
> interesting.  If i read it correctly, is says that the test fails because
> the test code is buggy, not because the systems headers are actually lacking
> the hypot function prototype.
>
> To me, this looks like a case of so-called compat code that actually
> breaks compatibility rather than making anything better...

Yes the test is buggy.  On my GNU/Linux system the test always says
'yes' although I obviously don't need the declaration.  I think we can
get ride of that one and replace it by gnulib's hypot module.  The patch
below fixes the build on Solaris 11 (need to call 'bootstrap' and
regenerate the tarball with 'make dist').  I'll do more tests this
weekend.

Regards,

Bertrand


diff --git a/bootstrap.conf b/bootstrap.conf
index 5161d1fd..6cf16c84 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -43,6 +43,7 @@ gnulib_modules="
     fprintf-posix
     snprintf
     vsnprintf
+    hypot
 "
 
 # Name of the Makefile.am
diff --git a/configure.ac b/configure.ac
index cb2bd10a..e0a049f6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,6 @@ GROFF_POSIX
 # checks for header stuff
 GROFF_SRAND
 GROFF_NEED_DECLARATION([gettimeofday])
-GROFF_NEED_DECLARATION([hypot])
 GROFF_NEED_DECLARATION([popen])
 GROFF_NEED_DECLARATION([pclose])
 GROFF_NEED_DECLARATION([putenv])
diff --git a/src/libs/libgroff/hypot.cpp b/src/libs/libgroff/hypot.cpp
index 3eb2fb96..1fa44d46 100644
--- a/src/libs/libgroff/hypot.cpp
+++ b/src/libs/libgroff/hypot.cpp
@@ -20,10 +20,6 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
 
-#ifdef NEED_DECLARATION_HYPOT
-  double hypot(double, double);
-#endif /* NEED_DECLARATION_HYPOT */
-  
 double groff_hypot(double x, double y)
 {
   double result = hypot(x, y);




reply via email to

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