From patchwork Mon Oct 29 12:16:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gabriel F. T. Gomes" X-Patchwork-Id: 990164 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-96793-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=inconstante.eti.br Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="yiuPR6m/"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42kD9x4xz2z9s7T for ; Mon, 29 Oct 2018 23:17:09 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=oi3F5zRSJxgnsl7RoxF/gyil5ugRe UJSxfB/zFdfGP1GO9l2KmIYuA2gwgmtZ+xeEE4Z0H2g4OsUSzb1wEEtLHUEwDkTs zsXYUTIXjqFuZzepzf6Kw6xprrPYnJ4k/lBSOjV5qBFO0yJxjyxwLS74K3bIqo99 g1D2aIoMrDOoIE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=oQTde22UFfhk6fwPCrym1pc+JC8=; b=yiu PR6m//7E8d7/qTjguDb/jITloLv84OQROF2R7yu+KACe8OiWrN3YkMusVQ03EwwE XZvoCxa3t8nKAlLVT+hZosyBqyc3RvtII16pqGEB5M6goAPLOeCjBiBSVdcwREff wVQhqgr5eNetyc58c7u9WQGAAt3PlGZaw6y4KhnI= Received: (qmail 16030 invoked by alias); 29 Oct 2018 12:17:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16015 invoked by uid 89); 29 Oct 2018 12:17:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=transition, omissions, duplicating, 32-bits X-HELO: mo20.mail-out.ovh.net From: "Gabriel F. T. Gomes" To: Subject: [PATCH v2 0/8] Use more flags parameters instead of global bits in stdio Date: Mon, 29 Oct 2018 09:16:42 -0300 Message-ID: <20181029121650.24544-1-gabriel@inconstante.eti.br> MIME-Version: 1.0 X-Ovh-Tracer-Id: 18031005535430692547 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrheekgdefjecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecu In March, Zack Weinberg posted a patch set [1] that, among many other improvements to code readability and symbol versioning, removed the TLS variable __ldbl_is_dbl. This patch set is very relevant in itself *and* it is very useful for the long double work on powerpc64le. I have a special interest in this patch set being approved and I worked on many of the comments that were raised during the review of the first version, as well as I have made other changes that were not mentioned at that time. Each of the patches contains a "Changed since v1" section, where I describe all (except for unintentional omissions, if any) changes, anyhow, I mention some of them below, because I think they might require additional attention: - I removed some occurrences of libc_hidden_def and libc_hidden_proto from function definitions that were not commented on in the previous discussion. I removed them because I checked that such functions are not called from within libc (although they could be called from libnldbl_nonshared.a). There could be other occurrences in the code, but before I work on a patch to get rid of them all, I thought it would be best to get feedback. - I added attribute_hidden to function declarations that were not commented on in the previous discussion. I did it because I understood that adding this attribute can lead to better code generation on some architectures, e.g. 32-bits powerpc, thus I also pasted the output of objdumps before and after the change. I hope that helps with the review. - I kept the definition of ldbl_compat_symbol based on my understanding that it would be best to have this additional macro, instead on relying on the implicit, suggested [2] semantics for LONG_DOUBLE_COMPAT_VERSION (i.e.: on platforms where a long double transition never occurred, we pretend that it occurred on GLIBC 2.0) - I removed the declaration of many functions (e.g.: _IO_vfprintf) from internal headers, because they are no longer called from within libc, thus the internal declaration is only duplicating code. [1] https://sourceware.org/ml/libc-alpha/2018-03/msg00185.html [2] https://sourceware.org/ml/libc-alpha/2018-06/msg00980.html Zack Weinberg (8): Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl. Add __vfscanf_internal and __vfwscanf_internal with flags arguments. Use SCANF_ISOC99_A instead of _IO_FLAGS2_SCANF_STD. Use SCANF_LDBL_IS_DBL instead of __ldbl_is_dbl. Add __v*printf_internal with flags arguments. Add __vsyslog_internal, with same flags as __v*printf_internal. Use PRINTF_FORTIFY instead of _IO_FLAGS2_FORTIFY. Use PRINTF_LDBL_IS_DBL instead of __ldbl_is_dbl. argp/argp-fmtstream.c | 3 +- argp/argp-help.c | 4 +- argp/argp-namefrob.h | 2 - debug/Makefile | 2 +- debug/asprintf_chk.c | 20 +- debug/dprintf_chk.c | 20 +- debug/fprintf_chk.c | 20 +- debug/fwprintf_chk.c | 20 +- debug/obprintf_chk.c | 96 +- debug/printf_chk.c | 20 +- debug/snprintf_chk.c | 24 +- debug/sprintf_chk.c | 25 +- debug/swprintf_chk.c | 27 +- debug/vasprintf_chk.c | 68 +- debug/vdprintf_chk.c | 37 +- debug/vfprintf_chk.c | 21 +- debug/vfwprintf_chk.c | 21 +- debug/vobprintf_chk.c | 32 + debug/vprintf_chk.c | 20 +- debug/vsnprintf_chk.c | 46 +- debug/vsprintf_chk.c | 69 +- debug/vswprintf_chk.c | 51 +- debug/vwprintf_chk.c | 21 +- debug/wprintf_chk.c | 21 +- hurd/vpprintf.c | 2 +- include/monetary.h | 12 +- include/stdio.h | 8 - include/sys/syslog.h | 19 +- include/wchar.h | 12 - libio/fwprintf.c | 2 +- libio/iolibio.h | 8 - libio/iovdprintf.c | 13 +- libio/iovsprintf.c | 66 +- libio/iovsscanf.c | 12 +- libio/iovswscanf.c | 14 +- libio/libio.h | 8 - libio/libioP.h | 77 +- libio/obprintf.c | 19 +- libio/strfile.h | 33 +- libio/swprintf.c | 2 +- libio/swscanf.c | 10 +- libio/vasprintf.c | 20 +- libio/vscanf.c | 2 +- libio/vsnprintf.c | 16 +- libio/vswprintf.c | 16 +- libio/vwprintf.c | 2 +- libio/vwscanf.c | 2 +- libio/wprintf.c | 2 +- libio/wscanf.c | 2 +- manual/locale.texi | 9 +- misc/syslog.c | 36 +- stdio-common/Makefile | 4 +- stdio-common/Versions | 3 + stdio-common/asprintf.c | 6 +- stdio-common/dprintf.c | 5 +- stdio-common/fprintf.c | 2 +- stdio-common/fxprintf.c | 4 +- stdio-common/iovfscanf.c | 38 + stdio-common/iovfwscanf.c | 38 + stdio-common/isoc99_fscanf.c | 7 +- stdio-common/isoc99_scanf.c | 12 +- stdio-common/isoc99_sscanf.c | 8 +- stdio-common/isoc99_vfscanf.c | 9 +- stdio-common/isoc99_vscanf.c | 9 +- stdio-common/isoc99_vsscanf.c | 16 +- stdio-common/printf.c | 3 +- stdio-common/scanf.c | 2 +- stdio-common/snprintf.c | 4 +- stdio-common/sprintf.c | 4 +- stdio-common/sscanf.c | 12 +- stdio-common/vfprintf-internal.c | 2360 +++++++++++++++++++++++ stdio-common/vfprintf.c | 2351 +---------------------- stdio-common/vfscanf-internal.c | 3045 ++++++++++++++++++++++++++++++ stdio-common/vfscanf.c | 3042 +---------------------------- stdio-common/vfwprintf-internal.c | 2 + stdio-common/vfwprintf.c | 28 +- stdio-common/vfwscanf-internal.c | 2 + stdio-common/vfwscanf.c | 28 +- stdio-common/vprintf.c | 4 +- stdlib/strfmon.c | 3 +- stdlib/strfmon_l.c | 8 +- stdlib/strfrom-skeleton.c | 2 +- sysdeps/generic/math_ldbl_opt.h | 5 +- sysdeps/generic/stdio-lock.h | 7 - sysdeps/ieee754/ldbl-opt/Makefile | 2 +- sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h | 9 +- sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 807 ++++---- sysdeps/ieee754/ldbl-opt/nldbl-compat.h | 8 +- sysdeps/nptl/stdio-lock.h | 7 - wcsmbs/isoc99_fwscanf.c | 7 +- wcsmbs/isoc99_swscanf.c | 11 +- wcsmbs/isoc99_vfwscanf.c | 9 +- wcsmbs/isoc99_vswscanf.c | 15 +- wcsmbs/isoc99_vwscanf.c | 9 +- wcsmbs/isoc99_wscanf.c | 7 +- 95 files changed, 6458 insertions(+), 6620 deletions(-) create mode 100644 debug/vobprintf_chk.c create mode 100644 stdio-common/iovfscanf.c create mode 100644 stdio-common/iovfwscanf.c create mode 100644 stdio-common/vfprintf-internal.c create mode 100644 stdio-common/vfscanf-internal.c create mode 100644 stdio-common/vfwprintf-internal.c create mode 100644 stdio-common/vfwscanf-internal.c