public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/28084]  New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
@ 2006-06-19 14:24 danglin at gcc dot gnu dot org
  2006-06-19 17:22 ` [Bug target/28084] " dave at hiauly1 dot hia dot nrc dot ca
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: danglin at gcc dot gnu dot org @ 2006-06-19 14:24 UTC (permalink / raw)
  To: gcc-bugs

/mnt/gnu/gcc/objdir/./gcc/xgcc -shared-libgcc -B/mnt/gnu/gcc/objdir/./gcc
-nostd
inc++ -L/mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src
-L/mnt/gnu/gc
c/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src/.libs
-B/opt/gnu/gcc/gcc-4.2.0/h
ppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-4.2.0/hppa2.0w-hp-hpux11.11/lib/
-i
system /opt/gnu/gcc/gcc-4.2.0/hppa2.0w-hp-hpux11.11/include -isystem
/opt/gnu/gc
c/gcc-4.2.0/hppa2.0w-hp-hpux11.11/sys-include
-I/mnt/gnu/gcc/objdir/hppa2.0w-hp-
hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11
-I/mnt/gnu/gcc/objdir/hppa2
.0w-hp-hpux11.11/libstdc++-v3/include -I/mnt/gnu/gcc/gcc/libstdc++-v3/libsupc++
-fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual
-fdiagnostics-
show-location=once -g -O2 -c c++locale.cc  -fPIC -DPIC -o .libs/c++locale.o
/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
make[4]: *** [c++locale.lo] Error 1
make[4]: Leaving directory
`/mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-
v3/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory
`/mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-
v3'
make[2]: *** [all] Error 2

-bash-2.05b$ ./xgcc -B./ -v
Reading specs from ./specs
Target: hppa2.0w-hp-hpux11.11
Configured with: ../gcc/configure --with-gnu-as --with-as=/opt/gnu/bin/as
--enable-shared --with-local-prefix=/opt/gnu --prefix=/opt/gnu/gcc/gcc-4.2.0
--with-gmp=/opt/gnu/gcc/gcc-4.2.0 --enable-debug=no --disable-nls
--enable-threads=posix --enable-languages=c,c++,objc,fortran,java,ada,obj-c++
Thread model: posix
gcc version 4.2.0 20060619 (experimental)


-- 
           Summary: /usr/include/errno.h:28: error: previous declaration of
                    'int errno' with 'C++' linkage
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danglin at gcc dot gnu dot org
 GCC build triplet: hppa2.0w-hp-hpux11.11
  GCC host triplet: hppa2.0w-hp-hpux11.11
GCC target triplet: hppa2.0w-hp-hpux11.11


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
@ 2006-06-19 17:22 ` dave at hiauly1 dot hia dot nrc dot ca
  2006-06-19 17:38 ` [Bug target/28084] [4.2 Regression] " pinskia at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2006-06-19 17:22 UTC (permalink / raw)
  To: gcc-bugs



------- 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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] [4.2 Regression] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
  2006-06-19 17:22 ` [Bug target/28084] " dave at hiauly1 dot hia dot nrc dot ca
@ 2006-06-19 17:38 ` pinskia at gcc dot gnu dot org
  2006-06-19 23:50 ` sje at cup dot hp dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-19 17:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-06-19 17:25 -------
See commment #6 in PR 27227 for more about this bug
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27227#c6


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |build
   Last reconfirmed|0000-00-00 00:00:00         |2006-06-19 17:25:44
               date|                            |
            Summary|/usr/include/errno.h:28:    |[4.2 Regression]
                   |error: previous declaration |/usr/include/errno.h:28:
                   |of 'int errno' with 'C++'   |error: previous declaration
                   |linkage                     |of 'int errno' with 'C++'
                   |                            |linkage
   Target Milestone|---                         |4.2.0


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] [4.2 Regression] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
  2006-06-19 17:22 ` [Bug target/28084] " dave at hiauly1 dot hia dot nrc dot ca
  2006-06-19 17:38 ` [Bug target/28084] [4.2 Regression] " pinskia at gcc dot gnu dot org
@ 2006-06-19 23:50 ` sje at cup dot hp dot com
  2006-06-20  0:22 ` dave at hiauly1 dot hia dot nrc dot ca
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: sje at cup dot hp dot com @ 2006-06-19 23:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from sje at cup dot hp dot com  2006-06-19 23:48 -------
There was nothing intentional about the different linkages, in unreleased HP-UX
sources, they fixed it to be in 'extern "C"' in both places.  Here is a patch
to inclhack.def that I have tested.  I haven't submitted it because I was
waiting for the MAINTAINERS change to happen.

fix = {
    hackname  = hpux11_extern_errno;
    mach      = "*-hp-hpux11.[0-2]*";
    files     = errno.h;
    select    = "^[ \t]*extern int errno;$";
    c_fix     = format;
    c_fix_arg = "#ifdef __cplusplus\nextern \"C\" {\n#endif\n%0\n#ifdef
__cplusplus\n}\n#endif";
    test_text = "   extern int errno;\n";
};


-- 

sje at cup dot hp dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sje at cup dot hp dot com


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] [4.2 Regression] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-06-19 23:50 ` sje at cup dot hp dot com
@ 2006-06-20  0:22 ` dave at hiauly1 dot hia dot nrc dot ca
  2006-06-23 16:35 ` sje at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: dave at hiauly1 dot hia dot nrc dot ca @ 2006-06-20  0:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dave at hiauly1 dot hia dot nrc dot ca  2006-06-20 00:07 -------
Subject: Re:  [4.2 Regression] /usr/include/errno.h:28: error: previous
declaration of 'int errno' with 'C++' linkage

>     mach      = "*-hp-hpux11.[0-2]*";

I believe that we also need the fix for hpux10.  I see

extern int errno;
#include <sys/errno.h>

in the HP-UX 10.20 version of errno.h with no extern "C" wrapper.

sys/errno.h has the wrapper.  Otherwise, the change looks good to
me.

Dave


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] [4.2 Regression] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-06-20  0:22 ` dave at hiauly1 dot hia dot nrc dot ca
@ 2006-06-23 16:35 ` sje at gcc dot gnu dot org
  2006-06-24  7:50 ` pinskia at gcc dot gnu dot org
  2006-07-10 17:19 ` sje at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: sje at gcc dot gnu dot org @ 2006-06-23 16:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from sje at gcc dot gnu dot org  2006-06-23 16:22 -------
Subject: Bug 28084

Author: sje
Date: Fri Jun 23 16:21:54 2006
New Revision: 114939

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=114939
Log:
        PR target/28084
        * inclhack.def (hpux_extern_errno): New.
        * fixincl.x: Regenerate.

Modified:
    trunk/fixincludes/ChangeLog
    trunk/fixincludes/fixincl.x
    trunk/fixincludes/inclhack.def


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] [4.2 Regression] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2006-06-23 16:35 ` sje at gcc dot gnu dot org
@ 2006-06-24  7:50 ` pinskia at gcc dot gnu dot org
  2006-07-10 17:19 ` sje at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-24  7:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from pinskia at gcc dot gnu dot org  2006-06-24 04:19 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug target/28084] [4.2 Regression] /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage
  2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2006-06-24  7:50 ` pinskia at gcc dot gnu dot org
@ 2006-07-10 17:19 ` sje at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: sje at gcc dot gnu dot org @ 2006-07-10 17:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from sje at gcc dot gnu dot org  2006-07-10 17:19 -------
Subject: Bug 28084

Author: sje
Date: Mon Jul 10 17:19:01 2006
New Revision: 115309

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=115309
Log:
        PR target/28084
        * inclhack.def (hpux_extern_errno): New.
        * fixincl.x: Regenerate.

Modified:
    branches/gcc-4_1-branch/fixincludes/ChangeLog
    branches/gcc-4_1-branch/fixincludes/fixincl.x
    branches/gcc-4_1-branch/fixincludes/inclhack.def


-- 


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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-07-10 17:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-19 14:24 [Bug target/28084] New: /usr/include/errno.h:28: error: previous declaration of 'int errno' with 'C++' linkage danglin at gcc dot gnu dot org
2006-06-19 17:22 ` [Bug target/28084] " dave at hiauly1 dot hia dot nrc dot ca
2006-06-19 17:38 ` [Bug target/28084] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-06-19 23:50 ` sje at cup dot hp dot com
2006-06-20  0:22 ` dave at hiauly1 dot hia dot nrc dot ca
2006-06-23 16:35 ` sje at gcc dot gnu dot org
2006-06-24  7:50 ` pinskia at gcc dot gnu dot org
2006-07-10 17:19 ` sje at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).