This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/28084] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
- From: "dave at hiauly1 dot hia dot nrc dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Jun 2006 17:07:35 -0000
- Subject: [Bug target/28084] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
- References: <bug-28084-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from dave at hiauly1 dot hia dot nrc dot ca 2006-06-19 17:07 -------
Subject: Re: New: /usr/include/errno.h:28: error: previous declaration of
'int errno' with 'C++' linkage
> /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++'
> linkage
> /usr/include/sys/errno.h:48: error: conflicts with new declaration with 'C'
> linkage
It appears to me that HP intentionally declares 'errno' with both
'C' and 'C++' linkage. This is what I see in sys/errno.h:
# ifdef __cplusplus
extern "C" {
# endif /* __cplusplus */
# if defined(_REENTRANT) && !defined(_PTHREADS_DRAFT4)
/* Get errno definition by including <errno.h> not <sys/errno.h> */
# else /* ! _REENTRANT || _PTHREADS_DRAFT4 */
extern int errno;
# endif /* ! _REENTRANT || _PTHREADS_DRAFT4 */
# ifdef __cplusplus
}
# endif /* __cplusplus */
Dave
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28084