This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH v2 0/8] Use more flags parameters instead of global bits in stdio


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

-- 
2.14.5


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]