public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Gabriel F.T.Gomes <gftg@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] ldbl-128ibm-compat: Fix selection of GNU and ISO C99 scanf
Date: Fri, 13 Dec 2019 21:13:00 -0000	[thread overview]
Message-ID: <20191213211311.114002.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=348787f06902b971d76dbab3f05d54c0b5c36131

commit 348787f06902b971d76dbab3f05d54c0b5c36131
Author: Gabriel F. T. Gomes <gabrielftg@linux.ibm.com>
Date:   Wed Nov 27 10:06:50 2019 -0600

    ldbl-128ibm-compat: Fix selection of GNU and ISO C99 scanf
    
    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>

Diff:
---
 sysdeps/ieee754/ldbl-128ibm-compat/Makefile                  | 8 ++++----
 sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c  | 4 ++++
 sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c | 4 ++++
 3 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
index b54eb04..21332bf 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/Makefile
@@ -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)
 
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c
index 0759d8a..116808d 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-scanf-ldbl-compat.c
@@ -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
diff --git a/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c
index e93cf3b..4b8fd1b 100644
--- a/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c
+++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-wscanf-ldbl-compat.c
@@ -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


                 reply	other threads:[~2019-12-13 21:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191213211311.114002.qmail@sourceware.org \
    --to=gftg@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).