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 with C99/C++11 and higher.


* 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


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