This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't always provide definition of gets
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Marek Polacek <polacek at redhat dot com>
- Cc: Ulrich Drepper <drepper at gmail dot com>, libc-alpha <libc-alpha at sourceware dot org>
- Date: Tue, 24 Jan 2012 22:22:45 +0000 (UTC)
- Subject: Re: [PATCH] Don't always provide definition of gets
- References: <4F0E9FBA.1030407@redhat.com>
On Thu, 12 Jan 2012, Marek Polacek wrote:
> In libio/stdio.h we guard the declaration of gets in a way that
> gets isn't available under _GNU_SOURCE and ISOC11 or under C++11,
> but the definition of gets in bits/stdio2.h, used when we want
> fortification, is always available. This triggers quite a lot of
> -Wmissing-prototypes-ish warnings. Thusly fixed.
I'm seeing failures of the testcases debug/tst-{lfs,}chk{2,3,5,6}.out -
specifically, the tests for fortification of gets, which makes me suspect
this patch (though I haven't bisected to confirm this).
I wonder if there should actually be an internal __USE_GETS or similar
macro to force all the declarations to be present for the sake of
testcases such as these. After all, repeating the definitions from
bits/stdio2.h in the testcase would rather defeat the point of testing
what the header actually does - but it's quite possible the tests are
using other declarations that require _GNU_SOURCE.
--
Joseph S. Myers
joseph@codesourcery.com