[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bison-3.8] Link error on HP-UX 11i
From: |
Akim Demaille |
Subject: |
Re: [bison-3.8] Link error on HP-UX 11i |
Date: |
Fri, 10 Sep 2021 18:36:46 +0200 |
Hi Larkin,
> Le 10 sept. 2021 à 03:45, Larkin Nickle <me@larbob.org> a écrit :
>
> Tested with GNU Bison 3.8. This happens with GCC or HP aCC. HP-UX 11i does
> not have strtol defined and this results in a link error.
>
> CCLD src/bison
> /usr/ccs/bin/ld: Unsatisfied symbols:
> strtof (first referenced in src/bison-counterexample.o) (code)
> make[2]: *** [Makefile:4831: src/bison] Error 1
Doh... Thanks for the report! I'm installing the patch below. Could you
please confirm that this tarball works? Thanks in advance!
https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.gz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.lz
https://www.lrde.epita.fr/~akim/private/bison/bison-3.8.3-84b7.tar.xz
commit 84b78cef9bd913013da0e8995a1b1763b3399d01
Author: Akim Demaille <akim.demaille@gmail.com>
Date: Fri Sep 10 11:08:23 2021 +0200
portability: don't use strtof
It is not available on HP-UX 11i.
Reported by Larkin Nickle <me@larbob.org>.
<https://lists.gnu.org/r/bug-bison/2021-09/msg00012.html>
Gnulib provides no replacement, but anyway we should be using doubles,
since difftime uses doubles.
* bootstrap.conf: We want portability on stdtod.
* src/counterexample.c: Use double, not float, for time measurements.
diff --git a/bootstrap.conf b/bootstrap.conf
index 6f1a3fc6..1d8614e7 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -45,7 +45,7 @@ gnulib_modules='
realloc-posix
relocatable-prog relocatable-script
rename
- spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strverscmp
+ spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strtod strverscmp
sys_ioctl
termios
timevar
diff --git a/lib/.gitignore b/lib/.gitignore
index c132149f..590b7942 100644
--- a/lib/.gitignore
+++ b/lib/.gitignore
@@ -391,6 +391,7 @@
/stripslash.c
/strndup.c
/strnlen.c
+/strtod.c
/strverscmp.c
/sys
/sys_ioctl.in.h
diff --git a/m4/.gitignore b/m4/.gitignore
index a7b5095c..f1554d4d 100644
--- a/m4/.gitignore
+++ b/m4/.gitignore
@@ -216,6 +216,7 @@
/strings_h.m4
/strndup.m4
/strnlen.m4
+/strtod.m4
/strverscmp.m4
/sys_ioctl_h.m4
/sys_resource_h.m4
diff --git a/src/counterexample.c b/src/counterexample.c
index f6f85fb1..ec427c1e 100644
--- a/src/counterexample.c
+++ b/src/counterexample.c
@@ -57,12 +57,12 @@
/** The time limit before printing an assurance message to the user to
* indicate that the search is still running. */
-#define ASSURANCE_LIMIT 2.0f
+#define ASSURANCE_LIMIT 2.0
/* The time limit before giving up looking for unifying counterexample. */
-static float time_limit = 5.0f;
+static double time_limit = 5.0;
-#define CUMULATIVE_TIME_LIMIT 120.0f
+#define CUMULATIVE_TIME_LIMIT 120.0
// This is the fastest way to get the tail node from the gl_list API.
static gl_list_node_t
@@ -1164,7 +1164,7 @@ unifying_example (state_item_number itm1,
}
if (TIME_LIMIT_ENFORCED)
{
- float time_passed = difftime (time (NULL), start);
+ double time_passed = difftime (time (NULL), start);
if (!assurance_printed && time_passed > ASSURANCE_LIMIT
&& stage3result)
{
@@ -1218,7 +1218,7 @@ counterexample_init (void)
if (cp)
{
char *end = NULL;
- float v = strtof (cp, &end);
+ double v = strtod (cp, &end);
if (*end == '\0' && errno == 0)
time_limit = v;
}