https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93727
--- Comment #39 from Harald Anlauf <anlauf at gcc dot gnu.org> ---
(In reply to Jerry DeLisle from comment #38)
> (In reply to Harald Anlauf from comment #37)
> > (In reply to Jerry DeLisle from comment #33)
> > > Created attachment 64540 [details]
> > > Proposed patch to handle rounding of hexadecimal formats
> >
> > Apart from some GNU style issues (try ./contrib/check_GNU_style.sh on the
> > patch)
> > it works here.
> >
> > For completeness it may be useful to have one or two cases with explicit
> > rounding specifiers (like RU, RD) to compare round-to-nearest to the
> > expected rounding.
>
> I have added a new testcase called EXrounding.F90 to do this. I have style
> checks done as well. As soon as I go through a clean pull and fresh
> regression tests, I will push. Thanks Harald.
Please do not forget to inform the list!
BTW: I see testsuite failures on Power. Not sure if related, but I see
also warnings compiling libgfortran/io/write.c:
In file included from ../../../gcc-trunk/libgfortran/io/write.c:53:
../../../gcc-trunk/libgfortran/io/write_float.def: In Funktion
»get_float_hex_string«:
../../../gcc-trunk/libgfortran/io/write_float.def:177:57: warning: Format
»%llX« erwartet Argumenttyp »long long unsigned int«, aber Argument 5 hat Typ
»long unsigned int« [-Wformat=]
177 | result = snprintf (buffer, 25, "-0X%X.%13.13llXP%+d",
int_part,
| ~~~~~~~~^
| |
| long long
unsigned int
| %13.13lX
178 | (GFC_UINTEGER_8) frac_part, expon);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| long unsigned int
I think the warnings are correct, and wonder whether one should use/pass
(long long unsigned) instead of (GFC_UINTEGER_8).