This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51785] gets not anymore declared
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 10 Jan 2012 22:24:10 +0000
- Subject: [Bug c++/51785] gets not anymore declared
- Auto-submitted: auto-generated
- References: <bug-51785-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51785
vries at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |vries at gcc dot gnu.org
--- Comment #2 from vries at gcc dot gnu.org 2012-01-10 22:24:10 UTC ---
(In reply to comment #1)
> I thought this was fixed in glibc:
> http://sourceware.org/bugzilla/show_bug.cgi?id=13566
> ?
AFAIU GLIBC BZ #13528 was fixed, but there is a new checkin from Ulrich which
breaks libstdc++ build in a similar way:
...
$ git show c3a87236702cb73be1dada3438bbd3c3934e83f8
commit c3a87236702cb73be1dada3438bbd3c3934e83f8
Author: Ulrich Drepper <drepper@gmail.com>
Date: Sat Jan 7 10:41:00 2012 -0500
Do not declare gets in _GNU_SOURCE mode at all
diff --git a/ChangeLog b/ChangeLog
index 8f9558c..f089e19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2012-01-07 Ulrich Drepper <drepper@gmail.com>
+ * libio/stdio.h: Do not declare gets at all for _GNU_SOURCE.
+
* elf/tst-unique3.cc: Add explicit declaration of gets.
* elf/tst-unique3lib.cc: Likewise.
* elf/tst-unique3lib2.cc: Likewise.
diff --git a/libio/stdio.h b/libio/stdio.h
index d9cb573..28c98e9 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -629,7 +629,7 @@ extern char *fgets (char *__restrict __s, int __n, FILE
*__restrict __stream)
__wur;
#if !defined __USE_ISOC11 \
- || (defined __cplusplus && __cplusplus <= 201103L)
+ || (defined __cplusplus && __cplusplus <= 201103L && !defined __USE_GNU)
/* Get a newline-terminated string from stdin, removing the newline.
DO NOT USE THIS FUNCTION!! There is no limit on how much it will read.
...