This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/63471] [5.0 Regression] unix.c:1906:10: error: implicit declaration of function 'ttyname_r'
- From: "dave.anglin at bell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Oct 2014 15:37:16 +0000
- Subject: [Bug libfortran/63471] [5.0 Regression] unix.c:1906:10: error: implicit declaration of function 'ttyname_r'
- Auto-submitted: auto-generated
- References: <bug-63471-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63471
--- Comment #3 from dave.anglin at bell dot net ---
On 10/8/2014 9:43 AM, jb at gcc dot gnu.org wrote:
> Hmm, maybe add something like
>
> AC_CHECK_DECLS_ONCE([ttyname_r])
>
> to configure.ac and then in unix.c(stream_ttyname) check with
>
> #ifdef HAVE_TTYNAME_R && HAVE_DECL_TTYNAME_R
Don't we want to use ttyname_r in multithreaded applications?
It seems HP-UX is the only platform to hide the declaration of ttyname_r
using _REENTRANT :-(
If configure finds ttyname_r, then presumably we don't need pthread
linking for it.
On some platforms (MacOS 10.4 and Solaris 11), ttyname_r may return a
'char *', not 'int'.
Dave