mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-20 17:53:02 +00:00
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.
This commit is contained in:
@@ -45,7 +45,7 @@ gnulib_modules='
|
|||||||
realloc-posix
|
realloc-posix
|
||||||
relocatable-prog relocatable-script
|
relocatable-prog relocatable-script
|
||||||
rename
|
rename
|
||||||
spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strverscmp
|
spawn-pipe stdbool stpcpy stpncpy strdup-posix strerror strtod strverscmp
|
||||||
sys_ioctl
|
sys_ioctl
|
||||||
termios
|
termios
|
||||||
timevar
|
timevar
|
||||||
|
|||||||
1
lib/.gitignore
vendored
1
lib/.gitignore
vendored
@@ -391,6 +391,7 @@
|
|||||||
/stripslash.c
|
/stripslash.c
|
||||||
/strndup.c
|
/strndup.c
|
||||||
/strnlen.c
|
/strnlen.c
|
||||||
|
/strtod.c
|
||||||
/strverscmp.c
|
/strverscmp.c
|
||||||
/sys
|
/sys
|
||||||
/sys_ioctl.in.h
|
/sys_ioctl.in.h
|
||||||
|
|||||||
1
m4/.gitignore
vendored
1
m4/.gitignore
vendored
@@ -216,6 +216,7 @@
|
|||||||
/strings_h.m4
|
/strings_h.m4
|
||||||
/strndup.m4
|
/strndup.m4
|
||||||
/strnlen.m4
|
/strnlen.m4
|
||||||
|
/strtod.m4
|
||||||
/strverscmp.m4
|
/strverscmp.m4
|
||||||
/sys_ioctl_h.m4
|
/sys_ioctl_h.m4
|
||||||
/sys_resource_h.m4
|
/sys_resource_h.m4
|
||||||
|
|||||||
@@ -57,12 +57,12 @@
|
|||||||
|
|
||||||
/** The time limit before printing an assurance message to the user to
|
/** The time limit before printing an assurance message to the user to
|
||||||
* indicate that the search is still running. */
|
* 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. */
|
/* 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.
|
// This is the fastest way to get the tail node from the gl_list API.
|
||||||
static gl_list_node_t
|
static gl_list_node_t
|
||||||
@@ -1164,7 +1164,7 @@ unifying_example (state_item_number itm1,
|
|||||||
}
|
}
|
||||||
if (TIME_LIMIT_ENFORCED)
|
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
|
if (!assurance_printed && time_passed > ASSURANCE_LIMIT
|
||||||
&& stage3result)
|
&& stage3result)
|
||||||
{
|
{
|
||||||
@@ -1218,7 +1218,7 @@ counterexample_init (void)
|
|||||||
if (cp)
|
if (cp)
|
||||||
{
|
{
|
||||||
char *end = NULL;
|
char *end = NULL;
|
||||||
float v = strtof (cp, &end);
|
double v = strtod (cp, &end);
|
||||||
if (*end == '\0' && errno == 0)
|
if (*end == '\0' && errno == 0)
|
||||||
time_limit = v;
|
time_limit = v;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user