This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2 13/30] ldbl-128ibm-compat: Add ISO C99 versions of scanf functions
- From: "Gabriel F. T. Gomes" <gabriel at inconstante dot net dot br>
- To: Paul E Murphy <murphyp at linux dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 21 Nov 2019 10:43:43 -0300
- Subject: Re: [PATCH v2 13/30] ldbl-128ibm-compat: Add ISO C99 versions of scanf functions
- References: <20191025153410.15405-1-gabriel@inconstante.net.br> <20191025153410.15405-14-gabriel@inconstante.net.br> <9dfc38ae-4b23-d70b-73b8-4e7cacda438c@linux.ibm.com>
Hi, Paul,
I'm sorry I took so long to reply to this message. It sent me down a
rabbit hole.
On Fri, 08 Nov 2019, Paul E Murphy wrote:
>
>On 10/25/19 10:33 AM, Gabriel F. T. Gomes wrote:
>> From: "Gabriel F. T. Gomes" <gabrielftg@linux.ibm.com>
>>
>> --- /dev/null
>> +++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-isoc99-scanf-ieee128.c
>> @@ -0,0 +1,13 @@
>> +#undef _GNU_SOURCE
>> +/* The following macro definitions are a hack. They word around disabling
>> + the GNU extension while still using a few internal headers. */
>
>Indeed a hack. How frail is this?
A bit too much! :B
I spent some time trying to remember why I thought that was necessary and
I have a better understanding, now.
This hack is only really necessary for the wide-character versions of the
tests, because in wcsmbs/wchar.h, the redirections for vfwscanf, vwscanf,
and, more specifically, vswscanf to their ISO C99 versions is protected by
#if !defined __USE_GNU, whereas the redirections for fwscanf, wscanf, and
swscanf, as well as for all of the non-wide equivalents is protected by
#if !__GLIBC_USE (DEPRECATED_SCANF).
The use of DEPRECATED_SCANF is somewhat recent (added by commit ID
03992356e6fe) and it is my understanding that the change is missing for
vswscanf (and friends) simply due to oversight.
I have a patch to implement the missing change and I just finished running
it with build-many-glibcs.py. I'll send it for review.
>> +#define u_char unsigned char
>> +#define u_short unsigned short
>> +#define u_int unsigned int
>> +#define u_long unsigned long
>> +#include <libio/stdio.h>
>> +#include <stdlib/stdlib.h>
>> +#include <string/string.h>
>> +#include <wcsmbs/wchar.h>
>>
>> [...]
>>
>> --- /dev/null
>> +++ b/sysdeps/ieee754/ldbl-128ibm-compat/test-isoc99-wscanf-ieee128.c
>> @@ -0,0 +1,13 @@
>> +#undef _GNU_SOURCE
>> +/* The following macro definitions are a hack. They word around disabling
>> + the GNU extension while still using a few internal headers. */
>
>The same hack shows up four times, should it be isolated in one place?
With the fix, I'll try and make it all go away. Thanks for pointing that out.