public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
@ 2003-06-22 17:07 numien at deathwyrm dot net
2003-06-22 18:17 ` [Bug c++/11285] " bangerth at dealii dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: numien at deathwyrm dot net @ 2003-06-22 17:07 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
Summary: GCC 3.3 C++ for Sparc Solaris assumes system header
files are C.
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: numien at deathwyrm dot net
CC: gcc-bugs@gcc.gnu.org
I noticed this problem first with GCC 3.2.3, upgraded to the latest build I
could get to compile (3.3), and it still exists. It only seems to appear on
Sparc Solaris, I could not reproduce it on any other platform, including Sparc
Linux.
Essentially, it appears any header file included as "#include <header>" is
assumed to be C, even when included in C++ (.cc, .C, .cpp all tested) code. This
causes errors if function overloading is used.
I reproduced the problem with a very simple test, one header file in
/usr/include containing an overloaded function definition, and a C++ main that
only includes the header and returns 1. The .ii file looks correct, but on
compile it complains that declaration of C function `int test(int, int)'
conflicts with `int test(int)'.
Your bug reporting guidelines specify to include the preprocessed .ii file, but
I don't see any method of attaching a file here. If one would be helpful, please
feel free to e-mail me.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
@ 2003-06-22 18:17 ` bangerth at dealii dot org
2003-06-22 23:05 ` numien at deathwyrm dot net
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: bangerth at dealii dot org @ 2003-06-22 18:17 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
------- Additional Comments From bangerth at dealii dot org 2003-06-22 18:17 -------
System headers really _are_ usually C, not C++. On many systems,
they are therefore wrapped into
extern "C" {
...
}
blocks if C++ is used. Can you check whether that is the case on
your system as well?
Wolfgang
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
2003-06-22 18:17 ` [Bug c++/11285] " bangerth at dealii dot org
@ 2003-06-22 23:05 ` numien at deathwyrm dot net
2003-06-22 23:25 ` pinskia at physics dot uc dot edu
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: numien at deathwyrm dot net @ 2003-06-22 23:05 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
------- Additional Comments From numien at deathwyrm dot net 2003-06-22 23:05 -------
The real system headers mostly are, yes, the ones I'm creating for my own
development aren't. And those are the ones with problems.
As I mentioned earlier, I reproduced the problem with a very simple set of
files. The contents of the two simple files are as below.
/usr/include/test.h
------------------------
int test (int a);
int test (int a, int b);
------------------------
test.cpp
------------------
#include <test.h>
int main(void) {
return 1;
}
------------------
Also of note, when I put the file in the current directory and include it with
'#include "test.h"' it compiles fine.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
2003-06-22 18:17 ` [Bug c++/11285] " bangerth at dealii dot org
2003-06-22 23:05 ` numien at deathwyrm dot net
@ 2003-06-22 23:25 ` pinskia at physics dot uc dot edu
2003-06-22 23:33 ` numien at deathwyrm dot net
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-06-22 23:25 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
pinskia at physics dot uc dot edu changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-06-22 23:25:46
date| |
------- Additional Comments From pinskia at physics dot uc dot edu 2003-06-22 23:25 -------
the config file of solaris does not define NO_IMPLICIT_EXTERN_C which says the header files in the
system path is c++ aware. I think this is a feature until Sun (your provider) releases a system with
c++ aware headers. I do not know when that is, you have to ask them.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (2 preceding siblings ...)
2003-06-22 23:25 ` pinskia at physics dot uc dot edu
@ 2003-06-22 23:33 ` numien at deathwyrm dot net
2003-06-22 23:36 ` pinskia at physics dot uc dot edu
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: numien at deathwyrm dot net @ 2003-06-22 23:33 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
------- Additional Comments From numien at deathwyrm dot net 2003-06-22 23:33 -------
Perhaps I am misunderstanding what you said, but they look fairly C++ aware to
me...here's a clip from the top of stdio.h...
I'm using Solaris 9, perhaps they implemented that with this version?
In which file could I find that value to change? I can test it here.
---------------------------------------------------------------------
<snip>
/*
* Copyright (c) 1993-2001, by Sun Microsystems, Inc.
* All rights reserved.
*/
<snip>
/*
* Allow global visibility for symbols defined in
* C++ "std" namespace in <iso/stdio_iso.h>.
*/
#if __cplusplus >= 199711L
using std::FILE;
using std::size_t;
using std::fpos_t;
<snip>
using std::perror;
#endif
#ifdef __cplusplus
extern "C" {
#endif
<etc, etc...>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (3 preceding siblings ...)
2003-06-22 23:33 ` numien at deathwyrm dot net
@ 2003-06-22 23:36 ` pinskia at physics dot uc dot edu
2003-06-23 7:57 ` gdr at integrable-solutions dot net
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-06-22 23:36 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
------- Additional Comments From pinskia at physics dot uc dot edu 2003-06-22 23:36 -------
Then it looks like this can be fix for 2.9 (aka Solaris 9) only. Then the feature needs to be disabled
on Solaris 9.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (4 preceding siblings ...)
2003-06-22 23:36 ` pinskia at physics dot uc dot edu
@ 2003-06-23 7:57 ` gdr at integrable-solutions dot net
2003-06-23 7:58 ` gdr at integrable-solutions dot net
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-06-23 7:57 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
------- Additional Comments From gdr at integrable-solutions dot net 2003-06-23 07:45 -------
Subject: Re: GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
"numien at deathwyrm dot net" <gcc-bugzilla@gcc.gnu.org> writes:
| Perhaps I am misunderstanding what you said, but they look fairly C++ aware to
| me...here's a clip from the top of stdio.h...
Indeed.
| I'm using Solaris 9, perhaps they implemented that with this version?
| In which file could I find that value to change? I can test it here.
|
| ---------------------------------------------------------------------
| <snip>
| /*
| * Copyright (c) 1993-2001, by Sun Microsystems, Inc.
| * All rights reserved.
| */
| <snip>
| /*
| * Allow global visibility for symbols defined in
| * C++ "std" namespace in <iso/stdio_iso.h>.
| */
| #if __cplusplus >= 199711L
Aha, I get it. Currently g++ (or libstdc++-v3 I can tell which)
defines __cplusplus to 1L because we don't know how to handle Sun's C
system headers which are already C++ aware. The point is: In this
specific case, it is not that Sun's are not C++ aware, the problem is
that they *are*, but we don't know how to build libstdc++-v3 with such
systems. Put differently, it is our fault. The fix is not obbious though.
There should be an open issue related to __cplusplus somewhere in the
archive.
-- gaby
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (5 preceding siblings ...)
2003-06-23 7:57 ` gdr at integrable-solutions dot net
@ 2003-06-23 7:58 ` gdr at integrable-solutions dot net
2003-07-29 18:50 ` numien at deathwyrm dot net
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gdr at integrable-solutions dot net @ 2003-06-23 7:58 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
------- Additional Comments From gdr at integrable-solutions dot net 2003-06-23 07:45 -------
Subject: Re: GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
"pinskia at physics dot uc dot edu" <gcc-bugzilla@gcc.gnu.org> writes:
| Then it looks like this can be fix for 2.9 (aka Solaris 9) only. Then the feature needs to be disabled
| on Solaris 9.
See past discussion on an issue related to __cplucplus.
-- Gaby
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (6 preceding siblings ...)
2003-06-23 7:58 ` gdr at integrable-solutions dot net
@ 2003-07-29 18:50 ` numien at deathwyrm dot net
2003-08-23 0:32 ` dhazeghi at yahoo dot com
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: numien at deathwyrm dot net @ 2003-07-29 18:50 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
------- Additional Comments From numien at deathwyrm dot net 2003-07-29 18:50 -------
Took a bit of time to test and get back here (mostly due to problems with time
and Suns, gotta love 'em sometimes) but Andrew Pinski's solution seems to work
perfectly. Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (7 preceding siblings ...)
2003-07-29 18:50 ` numien at deathwyrm dot net
@ 2003-08-23 0:32 ` dhazeghi at yahoo dot com
2003-08-29 22:35 ` jason at gcc dot gnu dot org
2005-04-27 21:03 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: dhazeghi at yahoo dot com @ 2003-08-23 0:32 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
dhazeghi at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|3.4 |---
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (8 preceding siblings ...)
2003-08-23 0:32 ` dhazeghi at yahoo dot com
@ 2003-08-29 22:35 ` jason at gcc dot gnu dot org
2005-04-27 21:03 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: jason at gcc dot gnu dot org @ 2003-08-29 22:35 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
jason at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
------- Additional Comments From jason at gcc dot gnu dot org 2003-08-29 22:35 -------
*** This bug has been marked as a duplicate of 7327 ***
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/11285] GCC 3.3 C++ for Sparc Solaris assumes system header files are C.
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
` (9 preceding siblings ...)
2003-08-29 22:35 ` jason at gcc dot gnu dot org
@ 2005-04-27 21:03 ` cvs-commit at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2005-04-27 21:03 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2005-04-27 21:03 -------
Subject: Bug 11285
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mkoch@gcc.gnu.org 2005-04-27 21:03:00
Modified files:
libjava : ChangeLog
libjava/gnu/java/net/protocol/file: Connection.java
libjava/java/net: URLClassLoader.java
Log message:
2005-04-27 Chris Burdess <dog@gnu.org>
* gnu/java/net/protocol/file/Connection.java: Return correct content
length for directory listing.
* java/net/URLClassLoader.java: Correction for URLClassLoader, bug
#11285: return valid URLs for directories.i
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/ChangeLog.diff?cvsroot=gcc&r1=1.3568&r2=1.3569
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/gnu/java/net/protocol/file/Connection.java.diff?cvsroot=gcc&r1=1.10&r2=1.11
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libjava/java/net/URLClassLoader.java.diff?cvsroot=gcc&r1=1.28&r2=1.29
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11285
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2005-04-27 21:03 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-22 17:07 [Bug c++/11285] New: GCC 3.3 C++ for Sparc Solaris assumes system header files are C numien at deathwyrm dot net
2003-06-22 18:17 ` [Bug c++/11285] " bangerth at dealii dot org
2003-06-22 23:05 ` numien at deathwyrm dot net
2003-06-22 23:25 ` pinskia at physics dot uc dot edu
2003-06-22 23:33 ` numien at deathwyrm dot net
2003-06-22 23:36 ` pinskia at physics dot uc dot edu
2003-06-23 7:57 ` gdr at integrable-solutions dot net
2003-06-23 7:58 ` gdr at integrable-solutions dot net
2003-07-29 18:50 ` numien at deathwyrm dot net
2003-08-23 0:32 ` dhazeghi at yahoo dot com
2003-08-29 22:35 ` jason at gcc dot gnu dot org
2005-04-27 21:03 ` cvs-commit 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).