From 16578fa7b34a92c40f6c657ddadc33a7384b6537 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 27 Dec 2011 09:53:32 -0500 Subject: [PATCH] Better gets prototype and fallout from removal --- libio/stdio.h | 2 +- stdio-common/tst-gets.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/libio/stdio.h b/libio/stdio.h index 3656bb5590..b39202879c 100644 --- a/libio/stdio.h +++ b/libio/stdio.h @@ -638,7 +638,7 @@ extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) This function is a possible cancellation point and therefore not marked with __THROW. */ -extern char *gets (char *__s) __wur; +extern char *gets (char *__s) __wur __attribute_deprecated__; #endif __END_NAMESPACE_STD diff --git a/stdio-common/tst-gets.c b/stdio-common/tst-gets.c index 87786f5b71..463f345e0e 100644 --- a/stdio-common/tst-gets.c +++ b/stdio-common/tst-gets.c @@ -1,5 +1,5 @@ /* Tests for gets. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2011 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 2001. @@ -21,6 +21,11 @@ #include #include +/* The header does not include the declaration for gets + anymore when compiling with _GNU_SOURCE. Provide a copy here. */ +extern char *gets (char *__s); + + int main (void) { -- 2.43.5