https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125623
Bug ID: 125623
Summary: [17 Regression] write_float.def:44:37: error: implicit
declaration o f function 'frexpl'
[-Wimplicit-function-declaration]
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libfortran
Assignee: unassigned at gcc dot gnu.org
Reporter: danglin at gcc dot gnu.org
CC: jvdelisle at gcc dot gnu.org
Target Milestone: ---
Host: hppa64-hp-hpux11.11
Target: hppa64-hp-hpux11.11
Build: hppa64-hp-hpux11.11
The following build error was introduced in commit
5d0a9050f3a1c1f9f8e89188dec3d6f39c64a06a:
libtool: compile: /home/dave/gnu/gcc/objdir64/./gcc/xgcc
-B/home/dave/gnu/gcc/o
bjdir64/./gcc/ -B/opt/gnu64/gcc/gcc-17/hppa64-hp-hpux11.11/bin/
-B/opt/gnu64/gcc
/gcc-17/hppa64-hp-hpux11.11/lib/ -isystem
/opt/gnu64/gcc/gcc-17/hppa64-hp-hpux11
.11/include -isystem /opt/gnu64/gcc/gcc-17/hppa64-hp-hpux11.11/sys-include
-fche
cking=1 -DHAVE_CONFIG_H -I. -I../../../gcc/libgfortran
-iquote../../../gcc/libgf
ortran/io -I../../../gcc/libgfortran/../gcc
-I../../../gcc/libgfortran/../gcc/co
nfig -I../../../gcc/libgfortran/../libquadmath -I../.././gcc
-I../../../gcc/libgfortran/../libgcc -I../libgcc
-I../../../gcc/libgfortran/../libbacktrace -I../libbacktrace -I../libbacktrace
-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -Wextra -Wwrite-strings
-Werror=implicit-function-declaration -Werror=vla -fcx-fortran-rules
-ffunction-sections -fdata-sections -O2 -g -MT io/write.lo -MD -MP -MF
io/.deps/write.Tpo -c ../../../gcc/libgfortran/io/write.c -DPIC -o
io/.libs/write.o
In file included from ../../../gcc/libgfortran/io/write.c:53:
../../../gcc/libgfortran/io/write_float.def: In function
'get_float_hex_string':
../../../gcc/libgfortran/io/write_float.def:44:37: error: implicit declaration
of function 'frexpl' [-Wimplicit-function-declaration]
44 | # define GFC_REAL_16_FREXP(x, e) frexpl (x, e)
| ^~~~~~
../../../gcc/libgfortran/io/write_float.def:281:16: note: in expansion of macro
'GFC_REAL_16_FREXP'
281 | mant = GFC_REAL_16_FREXP (val, &expon);
| ^~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:28:1: note: include '<math.h>' or
provide a declaration of 'frexpl'
27 | #include "config.h"
+++ |+#include <math.h>
28 |
../../../gcc/libgfortran/io/write_float.def:44:37: warning: incompatible
implicit declaration of built-in function 'frexpl'
[-Wbuiltin-declaration-mismatch]
44 | # define GFC_REAL_16_FREXP(x, e) frexpl (x, e)
| ^~~~~~
../../../gcc/libgfortran/io/write_float.def:281:16: note: in expansion of macro
'GFC_REAL_16_FREXP'
281 | mant = GFC_REAL_16_FREXP (val, &expon);
| ^~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:44:37: note: include '<math.h>' or
provide a declaration of 'frexpl'
../../../gcc/libgfortran/io/write_float.def:281:16: note: in expansion of macro
'GFC_REAL_16_FREXP'
281 | mant = GFC_REAL_16_FREXP (val, &expon);
| ^~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:46:37: error: implicit declaration
of function 'scalbnl' [-Wimplicit-function-declaration]
46 | # define GFC_REAL_16_SCALBN(x, n) scalbnl (x, n)
| ^~~~~~~
../../../gcc/libgfortran/io/write_float.def:286:20: note: in expansion of macro
'GFC_REAL_16_SCALBN'
286 | mant = GFC_REAL_16_SCALBN (mant, 4);
| ^~~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:46:37: note: include '<math.h>' or
provide a declaration of 'scalbnl'
../../../gcc/libgfortran/io/write_float.def:286:20: note: in expansion of macro
'GFC_REAL_16_SCALBN'
286 | mant = GFC_REAL_16_SCALBN (mant, 4);
| ^~~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:46:37: warning: incompatible
implicit declaration of built-in function 'scalbnl'
[-Wbuiltin-declaration-mismatch]
../../../gcc/libgfortran/io/write_float.def:286:20: note: in expansion of macro
'GFC_REAL_16_SCALBN'
286 | mant = GFC_REAL_16_SCALBN (mant, 4);
| ^~~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:46:37: note: include '<math.h>' or
provide a declaration of 'scalbnl'
../../../gcc/libgfortran/io/write_float.def:286:20: note: in expansion of macro
'GFC_REAL_16_SCALBN'
286 | mant = GFC_REAL_16_SCALBN (mant, 4);
| ^~~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:46:37: warning: incompatible
implicit declaration of built-in function 'scalbnl'
[-Wbuiltin-declaration-mismatch]
46 | # define GFC_REAL_16_SCALBN(x, n) scalbnl (x, n)
| ^~~~~~~
../../../gcc/libgfortran/io/write_float.def:300:40: note: in expansion of macro
'GFC_REAL_16_SCALBN'
300 | frac_hi = (long long unsigned) GFC_REAL_16_SCALBN (frac_val,
56);
| ^~~~~~~~~~~~~~~~~~
../../../gcc/libgfortran/io/write_float.def:46:37: note: include '<math.h>' or
provide a declaration of 'scalbnl'
../../../gcc/libgfortran/io/write_float.def:300:40: note: in expansion of macro
'GFC_REAL_16_SCALBN'
300 | frac_hi = (long long unsigned) GFC_REAL_16_SCALBN (frac_val,
56);
| ^~~~~~~~~~~~~~~~~~
make[3]: *** [Makefile:4629: io/write.lo] Error 1
The problem is long double is selected for GFC_REAL_16 but HP never completed
the c library implementation for long double.
We have in kinds.h:
#define GFC_REAL_16_IS_LONG_DOUBLE
typedef long double GFC_REAL_16;
typedef complex long double GFC_COMPLEX_16;
#define HAVE_GFC_REAL_16
#define HAVE_GFC_COMPLEX_16
#define GFC_REAL_16_HUGE 1.18973149535723176508575932662800702e4932l
#define GFC_REAL_16_TINY 3.36210314311209350626267781732175260e-4932l
#define GFC_REAL_16_LITERAL_SUFFIX l
#define GFC_REAL_16_LITERAL(X) (X ## l)
#define GFC_REAL_16_DIGITS 113
#define GFC_REAL_16_RADIX 2
#include "kinds-override.h"
scalbnl is a C99 builtin. I wonder if using the builtin variants
in write_float.def would fix this error.
I wondered about using _Float128 and libquadmath support but that's only
supported when $long_double_kind -ne 16.