[PATCH] Don't always provide definition of gets
Joseph S. Myers
joseph@codesourcery.com
Tue Jan 24 23:00:00 GMT 2012
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
More information about the Libc-alpha
mailing list