This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use C99-compliant scanf under _GNU_SOURCE with C99/C++11 and higher.
- From: Florian Weimer <fweimer at redhat dot com>
- To: Zack Weinberg <zackw at panix dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- Date: Mon, 17 Dec 2018 18:32:47 +0100
- Subject: Re: [PATCH] Use C99-compliant scanf under _GNU_SOURCE with C99/C++11 and higher.
- References: <20181217161827.12154-1-zackw@panix.com> <8736qw6qbb.fsf@oldenburg2.str.redhat.com> <CAKCAbMifWDJDwfF0nFAZB3dh+4bqx8dc=LDt1aZCg8yPnX=0Mw@mail.gmail.com>
* Zack Weinberg:
> On Mon, Dec 17, 2018 at 12:01 PM Florian Weimer <fweimer@redhat.com> wrote:
>> * Zack Weinberg:
>> > +
>> > + GCC's -Wformat warnings can detect most uses of this extension, as long
>> > + as all functions that call vscanf, vfscanf, or vsscanf are annotated with
>> > + __attribute__ ((format (scanf, ...))).
>>
>> What's the state of GCC warnings? Does GCC already anticipate this
>> change?
>
> Yes, that's what I meant. Current versions of GCC, in -std=[c|gnu]99
> mode, already diagnose use of `%as` in the old GNU sense, regardless
> of _GNU_SOURCE.
Looks like this behavior goes back to GCC 4.1 at least. Interesting.
Of course, what changed over time is the default compilation mode.
So I think the NEWS text is okay.
Thanks,
Florian