This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: c/7464: weak symbols alias definitions are broken in 3.1.1(weak alias regression from 2.95)
- From: Andreas Jaeger <aj at suse dot de>
- To: Wolfgang Bangerth <bangerth at ticam dot utexas dot edu>
- Cc: gcc at gcc dot gnu dot org, <gcc-gnats at gcc dot gnu dot org>
- Date: Fri, 25 Oct 2002 16:25:26 +0200
- Subject: Re: c/7464: weak symbols alias definitions are broken in 3.1.1(weak alias regression from 2.95)
- References: <Pine.LNX.4.44.0210250857490.12569-100000@gandalf.ticam.utexas.edu>
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