]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
ldbl-128ibm-compat: Fix selection of GNU and ISO C99 scanf
authorGabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Wed, 27 Nov 2019 16:06:50 +0000 (10:06 -0600)
committerGabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Fri, 13 Dec 2019 21:01:25 +0000 (18:01 -0300)
Since commit

commit 03992356e6fedc5a5e9d32df96c1a2c79ea28a8f
Author: Zack Weinberg <zackw@panix.com>
Date:   Sat Feb 10 11:58:35 2018 -0500

    Use C99-compliant scanf under _GNU_SOURCE with modern compilers.

the selection of the GNU versions of scanf functions requires both
_GNU_SOURCE and -std=c89.  This patch changes the tests in
ldbl-128ibm-compat so that they actually test the GNU versions (without
this change, the redirection to the ISO C99 version always happens, so
GNU versions of the new implementation (e.g. __scanfieee128) were left
untested).

Tested for powerpc64le.

Reviewed-by: Paul E. Murphy <murphyp@linux.ibm.com>
sysdeps/ieee754/ldbl-128ibm-compat/Makefile
sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c
sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c

index b54eb04f2223c9db3b72b46c3fa20df10f498bf9..21332bfbbbba971edd23598fd41d21b38a098879 100644 (file)
@@ -75,14 +75,14 @@ CFLAGS-test-obstack-chk-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
 CFLAGS-test-obstack-chk-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
 
 tests-internal += test-scanf-ieee128 test-scanf-ibm128
-CFLAGS-test-scanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
-CFLAGS-test-scanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
+CFLAGS-test-scanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
+CFLAGS-test-scanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
 
 $(objpfx)test-scanf-ieee128: gnulib-tests += $(f128-loader-link)
 
 tests-internal += test-wscanf-ieee128 test-wscanf-ibm128
-CFLAGS-test-wscanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi
-CFLAGS-test-wscanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi
+CFLAGS-test-wscanf-ieee128.c += -mfloat128 -mabi=ieeelongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
+CFLAGS-test-wscanf-ibm128.c += -mabi=ibmlongdouble -Wno-psabi -std=c89 -D_GNU_SOURCE
 
 $(objpfx)test-wscanf-ieee128: gnulib-tests += $(f128-loader-link)
 
index 0759d8afab70fd58fefa7bef50136ceeb3917f67..116808dffdbdfe4db87438545fce90120fefe8cb 100644 (file)
@@ -1,3 +1,7 @@
+/* Include stdio.h from libio/, because include/stdio.h and -std=c89 do
+   not work together.  */
+#include <libio/stdio.h>
+
 #define CHAR char
 #define L(x) x
 #define FSCANF fscanf
index e93cf3b9bd62e7d473b773868c0b28fdfe1c3fb9..4b8fd1b44226d7aeb1545015a94280060cc889e7 100644 (file)
@@ -1,3 +1,7 @@
+/* Include stdio.h from libio/, because include/stdio.h and -std=c89 do
+   not work together.  */
+#include <libio/stdio.h>
+
 #define CHAR wchar_t
 #define L(x) L##x
 #define FSCANF fwscanf