This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/51785] gets not anymore declared


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51785

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-11
          Component|c++                         |libstdc++
     Ever Confirmed|0                           |1

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-11 13:25:08 UTC ---
Thanks - I can't test this myself as I don't have the latest glibc sources but
will confirm it and change component to libstdc++

Ulrich, G++ unconditionally defines _GNU_SOURCE so __USE_GNU will always be
defined when <cstdio> includes <stdio.h>, so there's no point checking for it.

I think Tom's fix is along the right lines, but we probably want to check for
the gets() declaration using autoconf and define a _GLIBCXX macro rather than
having __GLIBC_PREREQ in the headers, then do:

#ifdef _GLIBCXX_NEED_GETS_DECL
extern "C" {
  extern char *gets (char *__s) __attribute__((deprecated));
}
#endif

At some point we might need to handle the case where the underlying platform
doesn't provide gets() at all (e.g. if libstdc++ is used on a platform which
only supports C11) but that's not the case for GNU libc and we can worry about
that if/when it happens.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]