- To: Ángel González <keisial@xxxxxxxxx>
- Subject: Re: alias of structure members
- From: Ian Lance Taylor <iant@xxxxxxxxxx>
- Date: Sat, 11 Feb 2012 21:41:12 -0800
- Cc: gcc-help@xxxxxxx
- Comment: DKIM? See http://www.dkim.org
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329630105; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Received:Received:Received:From:To:Cc:Subject: References:Date:In-Reply-To:Message-ID:User-Agent:MIME-Version: Content-Type:Content-Transfer-Encoding:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=ugLUy4EKzWeJSGCHVRwbuVfFzVQ=; b=mJi3coH5Si3TnU8 aiQRstOdKXs1qQXmJOHP2ZCDnQ9XEFMtBlHhisCemv/SQBapH+OIf/1FEM3jwmXo 7qNP6q5RtCa3CD/bfDEj6yDkH6HG2U34YOk/aind8ts5b4iPjIakOc8N24Uguctr 3ekEnPQkBxkuEHvY619S17wXQd0o=
- In-reply-to: <4F36DF4B.9090009@gmail.com> ("Ángel González"'s message of "Sat, 11 Feb 2012 22:36:11 +0100")
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Ángel González <keisial@xxxxxxxxx> writes:
> I'm trying to define some symbols which are just alias to the struct
> members of
> a global/static variable.
>
> See testcase below:
>
> struct Foo_struct {
> int Foodata;
> } Foo;
>
> extern int __attribute__((alias("Foo.Foodata"))) Localfoo;
...
> This syntax works fine in gcc 3.4 but seems to have disappeared in gcc4,
> where it complains that the symbol is aliased to undefined symbol.
I don't see any evidence that this actually worked in gcc 3.4. In 3.4
it would make Localfoo an alias for a symbol named literally
"Foo.Foodata". it would not make Localfoo an alias for the Foodata
field of the global variable Foo. I think gcc4 is kindly giving you an
error for something that never actually worked.
Ian
[Linux C Programming]
[Linux Kernel]
[eCos]
[Fedora Development]
[Fedora Announce]
[Autoconf]
[The DWARVES Debugging Tools]
[Yosemite Campsites]
[Yosemite News]
[Linux GCC]