This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/9] Add __vfscanf_internal and __vfwscanf_internal with flags arguments.
- From: "Gabriel F. T. Gomes" <gabriel at inconstante dot eti dot br>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 26 Mar 2018 12:27:52 -0300
- Subject: Re: [PATCH 2/9] Add __vfscanf_internal and __vfwscanf_internal with flags arguments.
- References: <20180307193205.4751-1-zackw@panix.com> <20180307193205.4751-3-zackw@panix.com>
On Wed, 07 Mar 2018, Zack Weinberg wrote:
>(It was necessary to introduce ldbl_compat_symbol for _IO_vfscanf.
>Please check that part of the patch very carefully, I am still not
>confident I understand all of the details of ldbl-opt.)
It looks good on powerpc64... Oldest symbol (where long double had the
same format as double) is still there as a compat symbol with version
GLIBC_2.3... The newer symbol, is a bit different, in the sense that it
is now a compat symbol (it was a default symbol previously).
Here's what readelf has to tell us:
Before the patch set:
1355: 00000000001eea70 124 FUNC GLOBAL DEFAULT 27 _IO_vfscanf@GLIBC_2.3
1356: 00000000001f0a98 23552 FUNC GLOBAL DEFAULT 27 _IO_vfscanf@@GLIBC_2.4
After the patch set:
1355: 00000000001f0bd0 136 FUNC GLOBAL DEFAULT 27 _IO_vfscanf@GLIBC_2.4
1356: 00000000001ee968 136 FUNC GLOBAL DEFAULT 27 _IO_vfscanf@GLIBC_2.3
For the static library, I think that Adhemerval is right (see comment below).
> * libio/libioP.h (SCANF_LDBL_IS_DBL, SCANF_ISOC99_A): New constants.
> (__vfscanf_internal, __vfwscanf_internal): New function prototypes.
> * libio/libio.h: Remove libc_hidden_proto for _IO_vfscanf.
~~~~~~~~
Spaces instead of tabs.
> * libio/strfile.h: Add multiple inclusion guard.
Perhaps mention the removal of stdio.h inclusion?
> * stdio-common/Versions: Mention GLIBC_2.28, so that
> it can be used in SHLIB_COMPAT expressions.
~~~~~~~~
Spaces instead of tabs.
>+extern int __vfscanf_internal (FILE *fp, const char *format, va_list argp,
>+ unsigned int flags);
~~~~~~~~~~~~~~~~~~~~~~~~
>+extern int __vfwscanf_internal (FILE *fp, const wchar_t *format, va_list argp,
>+ unsigned int flags);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Spaces instead of tabs.
>+/* Initialize an _IO_strfile SF and _IO_wide_data WD to read from wide
>+ string STRING, and return the corresponding FILE object. It is not
>+ necessary to fclose the FILE when it is no longer needed. */
>+static inline FILE *
>+_IO_strfile_readw (_IO_strfile *sf, struct _IO_wide_data *wd,
>+ const wchar_t *string)
~~~~~~~~~~~~~~~~
Spaces instead of tabs.
>--- /dev/null
>+++ b/stdio-common/iovfscanf.c
>@@ -0,0 +1,34 @@
>+/* Copyright (C) 1991-2018 Free Software Foundation, Inc.
Should this (and other new files) be copyright 2018, since they're new?
>--- a/stdio-common/vfscanf.c
>+++ b/stdio-common/vfscanf-internal.c
>-_IO_vfwscanf (FILE *s, const wchar_t *format, va_list argptr,
>- int *errp)
>+__vfwscanf_internal (FILE *s, const wchar_t *format, va_list argptr,
>+ unsigned int mode_flags)
~~~~~~~~~~~~~~~~
Spaces instead of tabs.
>-_IO_vfscanf_internal (FILE *s, const char *format, va_list argptr,
>- int *errp)
>+__vfscanf_internal (FILE *s, const char *format, va_list argptr,
>+ unsigned int mode_flags)
~~~~~~~~~~~~~~~~
Spaces instead of tabs.
>--- a/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
>+++ b/sysdeps/ieee754/ldbl-opt/math_ldbl_opt.h
>@@ -20,10 +20,14 @@
> long_double_symbol (libc, __GL_##name##_##aliasname, aliasname);
> # define long_double_symbol_1(lib, local, symbol, version) \
> versioned_symbol (lib, local, symbol, version)
>+# define ldbl_compat_symbol(lib, local, symbol, version) \
>+ compat_symbol (lib, local, symbol, LONG_DOUBLE_COMPAT_VERSION)
> #else
> # define ldbl_hidden_def(local, name) libc_hidden_def (name)
> # define ldbl_strong_alias(name, aliasname) strong_alias (name, aliasname)
> # define ldbl_weak_alias(name, aliasname) weak_alias (name, aliasname)
>+# define ldbl_compat_symbol(lib, local, symbol, version) \
>+ compat_symbol (lib, local, symbol, version)
I believe that Adhemerval's comment is correct and ldbl_compat_symbol
should translate to nothing when building static libraries.