[PATCH 1/3 V2] Fix __sprintfkf prototype in libgcc.

The prototype of __sprintfkf in _sprintfkf.h did not match the function in
_sprintfkf.c.  This patch fixes the prototype.  I also included the
_sprintfkf.h file in _sprintfkf.c to make sure the prototype is correct and to
eliminate a warning about declaring the function without a previous
declaration.

I have done bootstraps on a little endian power9 system with each of the long
double variants (128-bit IBM, 128-bit IEEE, 64-bit) enabled, and there were no
regressions in each of the builds with the previous version.

In addition, I have built 2 cross compilers from my x86_64 system to little
endian PowerPC Linux.  One build enabled decimal support and one disabled the
decimal support.  On the build that disabled decimal support, I verified that
the _Float128 <-> Decimal conversions were not built.

Can I check this patch into the master branch for GCC 11?

libgcc/
2021-03-01  Michael Meissner  <meiss...@linux.ibm.com>

        * config/rs6000/_sprintfkf.h (__sprintfkf): Fix prototype to match
        the function.
        * config/rs6000/_sprintfkf.c: Include _sprintfkf.h.
---
 libgcc/config/rs6000/_sprintfkf.c | 1 +
 libgcc/config/rs6000/_sprintfkf.h | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgcc/config/rs6000/_sprintfkf.c 
b/libgcc/config/rs6000/_sprintfkf.c
index a7fdfb483c9..2d624f14e25 100644
--- a/libgcc/config/rs6000/_sprintfkf.c
+++ b/libgcc/config/rs6000/_sprintfkf.c
@@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 #include <soft-fp.h>
 #include <quad-float128.h>
 #include <stdio.h>
+#include <_sprintfkf.h>
 
 /* This function must be built with IBM 128-bit as long double, so that we can
    access the strfroml function if do not have an IEEE 128-bit version, and if
diff --git a/libgcc/config/rs6000/_sprintfkf.h 
b/libgcc/config/rs6000/_sprintfkf.h
index 637d104c882..de9d7137f69 100644
--- a/libgcc/config/rs6000/_sprintfkf.h
+++ b/libgcc/config/rs6000/_sprintfkf.h
@@ -24,5 +24,4 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If 
not, see
 /* Declaration of the conversion function to IEEE 128-bit floating point from
    string using snprintf.  */
 
-extern int __sprintfkf (char *restrict, const char *restrict, ...);
-
+extern int __sprintfkf (char *restrict, const char *restrict, _Float128);
-- 
2.22.0


-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to