public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak alias regression from 2.95)
@ 2002-10-25 7:16 Wolfgang Bangerth
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Bangerth @ 2002-10-25 7:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7464; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Cc:
Subject: Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak
alias regression from 2.95)
Date: Fri, 25 Oct 2002 09:08:25 -0500 (CDT)
This is one more regression from 2.95 with respect to weak and alias
attributes:
--------------------------------------------------
extern int i __attribute__ ((alias ("__i")));
extern int i __attribute__ ((weak, alias ("__i")));
--------------------------------------------------
In contrast to c++/6074, which is similar but treats functions instead of
variables, this is broken in both C and C++, and is also not fixed on
mainline.
The messages I get are:
from C:
x.c:2: error: weak declaration of `i' must precede definition
from C++:
x.cc:2: error: redefinition of `int i'
x.cc:1: error: `int i' previously declared here
As said, gcc2.95 accepts this.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak alias regression from 2.95)
@ 2002-10-25 7:36 Andreas Jaeger
0 siblings, 0 replies; 4+ messages in thread
From: Andreas Jaeger @ 2002-10-25 7:36 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7464; it has been noted by GNATS.
From: Andreas Jaeger <aj@suse.de>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: gcc@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Subject: Re: c/7464: weak symbols alias definitions are broken in 3.1.1
(weak alias regression from 2.95)
Date: Fri, 25 Oct 2002 16:25:26 +0200
Wolfgang Bangerth <bangerth@ticam.utexas.edu> writes:
> This is one more regression from 2.95 with respect to weak and alias
> attributes:
> --------------------------------------------------
> extern int i __attribute__ ((alias ("__i")));
> extern int i __attribute__ ((weak, alias ("__i")));
> --------------------------------------------------
>
> In contrast to c++/6074, which is similar but treats functions instead of
> variables, this is broken in both C and C++, and is also not fixed on
> mainline.
>
> The messages I get are:
> from C:
> x.c:2: error: weak declaration of `i' must precede definition
> from C++:
> x.cc:2: error: redefinition of `int i'
> x.cc:1: error: `int i' previously declared here
>
> As said, gcc2.95 accepts this.
But that doesn't make it right here. The warning is correct.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak alias regression from 2.95)
@ 2002-10-25 7:46 Wolfgang Bangerth
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Bangerth @ 2002-10-25 7:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7464; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: Andreas Jaeger <aj@suse.de>
Cc: gcc@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>
Subject: Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak
alias regression from 2.95)
Date: Fri, 25 Oct 2002 09:39:13 -0500 (CDT)
> > --------------------------------------------------
> > extern int i __attribute__ ((alias ("__i")));
> > extern int i __attribute__ ((weak, alias ("__i")));
> > --------------------------------------------------
> >
> > The messages I get are:
> > from C:
> > x.c:2: error: weak declaration of `i' must precede definition
> > from C++:
> > x.cc:2: error: redefinition of `int i'
> > x.cc:1: error: `int i' previously declared here
>
> But that doesn't make it right here. The warning is correct.
OK, then we should close the report, right?
Regards
Wolfgang
PS: I still find the messages confusing -- both C and C++ talk about
"definitions", but there are none in this case...
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak alias regression from 2.95)
@ 2002-10-25 11:26 Richard Henderson
0 siblings, 0 replies; 4+ messages in thread
From: Richard Henderson @ 2002-10-25 11:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c/7464; it has been noted by GNATS.
From: Richard Henderson <rth@redhat.com>
To: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
Cc: gcc@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c/7464: weak symbols alias definitions are broken in 3.1.1 (weak alias regression from 2.95)
Date: Fri, 25 Oct 2002 11:24:00 -0700
On Fri, Oct 25, 2002 at 09:08:25AM -0500, Wolfgang Bangerth wrote:
> This is one more regression from 2.95 with respect to weak and alias
> attributes:
> --------------------------------------------------
> extern int i __attribute__ ((alias ("__i")));
> extern int i __attribute__ ((weak, alias ("__i")));
> --------------------------------------------------
This test case is broken. Despite the use of "extern",
the use of "alias" means that this is a definition.
So having two of them violates the ODR, and is indeed an error.
r~
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-10-25 18:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-25 7:16 c/7464: weak symbols alias definitions are broken in 3.1.1 (weak alias regression from 2.95) Wolfgang Bangerth
2002-10-25 7:36 Andreas Jaeger
2002-10-25 7:46 Wolfgang Bangerth
2002-10-25 11:26 Richard Henderson
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).