[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bash-2.05b build failure on HP/UX
From: |
Steven G. Johnson |
Subject: |
bash-2.05b build failure on HP/UX |
Date: |
Thu, 5 Feb 2004 18:45:35 -0500 (EST) |
Hi, I am trying to compile bash-2.05b on HP-UX (for PA-RISC), and
encountered a compilation failure (HP C compiler).
The error was:
gmake[1]: Entering directory `/home/fftw/bash-2.05b/builtins'
rm -f printf.o
./mkbuiltins -D . printf.def
cc -c -DHAVE_CONFIG_H -DSHELL -I. -I.. -I.. -I../include -I../lib -I.
-DHPUX -g printf.c || ( rm -f printf.c ; exit 1 )
cc: "printf.def", line 824: error 1718: Types are not
assignment-compatible.
gmake[1]: *** [printf.o] Error 1
gmake[1]: Leaving directory `/home/fftw/bash-2.05b/builtins'
gmake: *** [builtins/libbuiltins.a] Error 1
The offending line of printf.def is:
ret = strtofltmax (garglist->word->word, &ep);
(ret is a floatmax_t.)
If you look at the top of printf.def for the definitions of floatmax_t and
strtofltmax, you find that they are defined as "long double" and strtold,
respectively (HAVE_LONG_DOUBLE and HAVE_DECL_STRTOLD are both defined to 1
in config.h).
However, the problem is that the system strtold function in stdlib.h is
defined as returning long_double, not long double, and long_double is
defined in the same header as:
typedef struct {
uint32_t word1, word2, word3, word4;
} long_double;
So, you can't assign the result to a long double.
The workaround is to pretend STRTOLD is not defined, in which case the
code uses strtod instead. It would be fairly easy to write an autoconf
AC_TRY_COMPILE test to see if strtold and long double are assignment
compatible, which I guess is the general solution.
Cordially,
Steven G. Johnson
- bash-2.05b build failure on HP/UX,
Steven G. Johnson <=