public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/19474] New: wrong tree for extern "C" variables
@ 2005-01-16 23:15 sstrasser at systemhaus-gruppe dot de
2005-01-16 23:40 ` [Bug c++/19474] " pinskia at gcc dot gnu dot org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-01-16 23:15 UTC (permalink / raw)
To: gcc-bugs
I don't know if this ever has an effect on an output of gcc(are C variable names
ever different from C++ ones?), but there are two different trees which should
be equal:
example1:
extern "C"{ extern int a; }
extern "C"{ int a; }
example2:
extern "C"{ extern int a; }
int a;
those should be equal I think, but "a" is not DECL_EXTERN_C_P for example2.
if "a" is a function it is DECL_EXTERN_C_P in both examples.
--
Summary: wrong tree for extern "C" variables
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sstrasser at systemhaus-gruppe dot de
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong tree for extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
@ 2005-01-16 23:40 ` pinskia at gcc dot gnu dot org
2005-01-16 23:44 ` pinskia at gcc dot gnu dot org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-16 23:40 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-16 23:40 -------
I don't know if there is a bug here or not.
But note normal variables in the global namespace are not mangled either.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong tree for extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
2005-01-16 23:40 ` [Bug c++/19474] " pinskia at gcc dot gnu dot org
@ 2005-01-16 23:44 ` pinskia at gcc dot gnu dot org
2005-01-16 23:56 ` sstrasser at systemhaus-gruppe dot de
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-16 23:44 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-16 23:44 -------
Also the only use of DECL_EXTERN_C_P for variable decls is when mangling (this is unlike functions).
So what are you trying to do here?
I would suspect there is a bug, but a very latent bug which does not show up in the normaling
compiling of things.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong tree for extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
2005-01-16 23:40 ` [Bug c++/19474] " pinskia at gcc dot gnu dot org
2005-01-16 23:44 ` pinskia at gcc dot gnu dot org
@ 2005-01-16 23:56 ` sstrasser at systemhaus-gruppe dot de
2005-01-17 1:35 ` schlie at comcast dot net
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-01-16 23:56 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sstrasser at systemhaus-gruppe dot de 2005-01-16 23:55 -------
I totally agree that this is not important.
I just don't know gcc good enough to forecast the possible effects of that minor
bug so I thought it'd be interesting.
please close the bug if you are sure it doesn't have any effects on compilation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong tree for extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
` (2 preceding siblings ...)
2005-01-16 23:56 ` sstrasser at systemhaus-gruppe dot de
@ 2005-01-17 1:35 ` schlie at comcast dot net
2005-01-23 14:45 ` mueller at kde dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: schlie at comcast dot net @ 2005-01-17 1:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From schlie at comcast dot net 2005-01-17 01:35 -------
(In reply to comment #3)
Or might it be nearly just as easy to place all in the same tree initially,
and eliminate the potential ambiguity now that it's been identified?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong tree for extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
` (3 preceding siblings ...)
2005-01-17 1:35 ` schlie at comcast dot net
@ 2005-01-23 14:45 ` mueller at kde dot org
2005-01-31 7:48 ` sstrasser at systemhaus-gruppe dot de
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mueller at kde dot org @ 2005-01-23 14:45 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mueller at kde dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong tree for extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
` (4 preceding siblings ...)
2005-01-23 14:45 ` mueller at kde dot org
@ 2005-01-31 7:48 ` sstrasser at systemhaus-gruppe dot de
2005-01-31 7:49 ` [Bug c++/19474] wrong linkage of " sstrasser at systemhaus-gruppe dot de
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-01-31 7:48 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sstrasser at systemhaus-gruppe dot de 2005-01-31 07:48 -------
I think I was wrong, this is a bug _and_ has effects on compilation:
in example2(see above) int a is not extern "C" in the tree, AND it is C++
mangled in compiler output!
std 7.5.7 states that a once declared extern "C" function is extern "C" even if
defined without linkage specification. I can't find the same for variables, but
since this is a redeclaration that must be the true:
extern "C"{ extern int a; }
int a;
extern "C"{ int a; }
I've attached a simple test case. link it and you'll get an undefined reference
to "a".
--
What |Removed |Added
----------------------------------------------------------------------------
Severity|minor |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong linkage of extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
` (5 preceding siblings ...)
2005-01-31 7:48 ` sstrasser at systemhaus-gruppe dot de
@ 2005-01-31 7:49 ` sstrasser at systemhaus-gruppe dot de
2005-01-31 7:52 ` sstrasser at systemhaus-gruppe dot de
2005-01-31 14:58 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-01-31 7:49 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|wrong tree for extern "C" |wrong linkage of extern "C"
|variables |variables
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong linkage of extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
` (6 preceding siblings ...)
2005-01-31 7:49 ` [Bug c++/19474] wrong linkage of " sstrasser at systemhaus-gruppe dot de
@ 2005-01-31 7:52 ` sstrasser at systemhaus-gruppe dot de
2005-01-31 14:58 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: sstrasser at systemhaus-gruppe dot de @ 2005-01-31 7:52 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From sstrasser at systemhaus-gruppe dot de 2005-01-31 07:52 -------
Created an attachment (id=8111)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8111&action=view)
reference to a in c.c shouldn't be undefined
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/19474] wrong linkage of extern "C" variables
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
` (7 preceding siblings ...)
2005-01-31 7:52 ` sstrasser at systemhaus-gruppe dot de
@ 2005-01-31 14:58 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-31 14:58 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-01-31 14:58 -------
Actually the code is invalid, see PR 6548 which this is a dup of.
*** This bug has been marked as a duplicate of 6548 ***
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19474
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-01-31 14:58 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-16 23:15 [Bug c++/19474] New: wrong tree for extern "C" variables sstrasser at systemhaus-gruppe dot de
2005-01-16 23:40 ` [Bug c++/19474] " pinskia at gcc dot gnu dot org
2005-01-16 23:44 ` pinskia at gcc dot gnu dot org
2005-01-16 23:56 ` sstrasser at systemhaus-gruppe dot de
2005-01-17 1:35 ` schlie at comcast dot net
2005-01-23 14:45 ` mueller at kde dot org
2005-01-31 7:48 ` sstrasser at systemhaus-gruppe dot de
2005-01-31 7:49 ` [Bug c++/19474] wrong linkage of " sstrasser at systemhaus-gruppe dot de
2005-01-31 7:52 ` sstrasser at systemhaus-gruppe dot de
2005-01-31 14:58 ` pinskia 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).