[PATCH] Don't always provide definition of gets

Marek Polacek polacek@redhat.com
Tue Jan 24 23:01:00 GMT 2012


On 01/24/2012 11:22 PM, Joseph S. Myers wrote:
> 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).

Ooops, that may be the case indeed, sorry.

> 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.

I can imagine that we add to stdio{,2}.h "|| __USE_GETS" around the
gets and to relevant tests something like "#define __USE_GETS",
although it looks rather ugly.  Is this what you had in mind?
I can surely cook up a patch, if you'd like.  Thanks,

	Marek



More information about the Libc-alpha mailing list