|
From: | Ivan Vučica |
Subject: | Re: error compiling GUI - string constants |
Date: | Fri, 28 Jul 2017 12:44:00 +0000 |
On 28 Jul 2017, at 13:16, Ivan Vučica <address@hidden> wrote:
>
> Isn't it this? I'm intentionally grabbing an older version - I'm not sure which is the oldest GCC we support, but 3.4.5 documents alias:
>
> https://gcc.gnu.org/onlinedocs/gcc-3.4.5/gcc/Function-Attributes.html
>
> Quoting:
>
> =====
> alias ("target")
> The alias attribute causes the declaration to be emitted as an alias for another symbol, which must be specified. For instance,
> void __f () { /* Do something.
> */; }
> void f () __attribute__ ((weak, alias ("__f")));
>
>
> declares `f' to be a weak alias for `__f'. In C++, the mangled name for the target must be used.
>
> Not all target machines support this attribute.
>
> ====
It’s documented as a function attribute. It kind-of works as a variable attribute, but probably doesn’t.
> Though, again, as I asked before: why do we want this?
>
> I'm not sure we *need* anything more than the macro. Wouldn't we need this extra symbol only if we care about better binary compat (maybe for Darling's sake)?
It also helps bridging from other languages. Macros as a colossal pain to expose over FFIs, public symbols are trivial. dlsym works if it’s an alias, doesn’t work if it’s a macro.
David
[Prev in Thread] | Current Thread | [Next in Thread] |