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]

Re: [PATCH] Use C99-compliant scanf under _GNU_SOURCE.


On Mon, Feb 12, 2018 at 11:33 AM, Zack Weinberg <zackw@panix.com> wrote:
> On Mon, Feb 12, 2018 at 11:25 AM, Joseph Myers <joseph@codesourcery.com> wrote:
>> On Sat, 10 Feb 2018, Zack Weinberg wrote:
>>
>>> +#if defined __USE_ISOC99 || defined __USE_XOPEN2K
>>
>> That's equivalent to just #ifdef __USE_ISOC99 (since __USE_XOPEN2K implies
>> __USE_ISOC99; POSIX.1-2001 is based on C99).
>
> Well, that certainly throws the question of how anyone could possibly
> use the noncompliant vscanf into stark relief.

Presumably the history here is that we had v{,f,s}scanf before C99 did
(I haven't checked).  What if we use C99-complaint everything for any
mode involving __ISOC99_SOURCE, but we also relax the condition for
declaring v{,f,s}scanf in the first place, from __ISOC99_SOURCE to
(__ISOC99_SOURCE || !__STRICT_ANSI__)?  In other words, provide
v{,f,s}scanf under -std=gnu89 as well as under -std={c,gnu}99 and up.

(I care about this because, if you can't get at the noncompliant
vscanf without overriding __GLIBC_USE_DEPRECATED_SCANF, then why do we
have the noncompliant vscanf at all?)

zw


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