[PATCH] Don't always provide definition of gets
Joseph S. Myers
joseph@codesourcery.com
Wed Jan 25 16:58:00 GMT 2012
On Tue, 24 Jan 2012, Ulrich Drepper wrote:
> I added a patch.
With that I now see failures of the form:
In file included from /scratch/jmyers/fsf/46boot/lib/gcc/x86_64-unknown-linux-gnu/4.6.3/../../../../include/c++/4.6.3/cstdio:44:0,
from tst-unique3lib.cc:3:
tst-unique3lib.cc:1:14: error: previous declaration of 'char* gets(char*)' with 'C++' linkage
../include/stdio.h:172:29: error: conflicts with new declaration with 'C' linkage
I've applied this patch as the obvious fix. If the eventual libstdc++ fix
for gets issues conflicts in some way, then further changes might be
needed - but we can address that at the time (in some way that work with a
range of GCC versions).
2012-01-25 Joseph Myers <joseph@codesourcery.com>
* elf/tst-unique3.cc (gets): Remove declaration.
* elf/tst-unique3lib.cc (gets): Likewise.
* elf/tst-unique3lib2.cc (gets): Likewise.
* elf/tst-unique4.cc (gets): Likewise.
diff --git a/elf/tst-unique3.cc b/elf/tst-unique3.cc
index ec1e814..efdd6d7 100644
--- a/elf/tst-unique3.cc
+++ b/elf/tst-unique3.cc
@@ -1,5 +1,4 @@
#include "tst-unique3.h"
-extern char *gets (char *);
#include <cstdio>
#include "../dlfcn/dlfcn.h"
diff --git a/elf/tst-unique3lib.cc b/elf/tst-unique3lib.cc
index 5429dc5..fa8e85a 100644
--- a/elf/tst-unique3lib.cc
+++ b/elf/tst-unique3lib.cc
@@ -1,5 +1,3 @@
-extern char *gets (char *);
-
#include <cstdio>
#include "tst-unique3.h"
template<typename T> int S<T>::i = 1;
diff --git a/elf/tst-unique3lib2.cc b/elf/tst-unique3lib2.cc
index 76dadca..17d817e 100644
--- a/elf/tst-unique3lib2.cc
+++ b/elf/tst-unique3lib2.cc
@@ -1,5 +1,3 @@
-extern char *gets (char *);
-
#include <cstdio>
#include "tst-unique3.h"
diff --git a/elf/tst-unique4.cc b/elf/tst-unique4.cc
index e38ae83..575c70d 100644
--- a/elf/tst-unique4.cc
+++ b/elf/tst-unique4.cc
@@ -1,6 +1,5 @@
// BZ 12511
#include "tst-unique4.h"
-extern char *gets (char *);
#include <cstdio>
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list