Re: weakref and static

2005-12-17 Thread Alexandre Oliva
On Dec 17, 2005, Alexandre Oliva [EMAIL PROTECTED] wrote: On Dec 11, 2005, Alexandre Oliva [EMAIL PROTECTED] wrote: On Dec 1, 2005, [EMAIL PROTECTED] (Geoffrey Keating) wrote: The easiest solution to this is to require that weakrefs must be 'static', because the name that they define is not

Re: weakref and static

2005-12-17 Thread Geoffrey Keating
On 17/12/2005, at 10:08 AM, Jakub Jelinek wrote: But there are dozens of other uses of TREE_PUBLIC in the backends, so it wouldn't surprise me if something similar is not present on other arches. Normal aliases are usually declared through extern __typeof (foo) bar __attribute__((alias

Re: weakref and static

2005-12-11 Thread Alexandre Oliva
On Dec 1, 2005, [EMAIL PROTECTED] (Geoffrey Keating) wrote: The 'weakref' attribute is defined in terms of aliases. Now, if the user writes void foo(void) { } void bar(void) __attribute__((alias (foo))); then that causes 'bar' to be defined. Other translation units can use 'bar'. If

Re: weakref and static

2005-12-11 Thread Jakub Jelinek
On Sun, Dec 11, 2005 at 06:46:39PM -0200, Alexandre Oliva wrote: Err... The above is a bit misleading, in that it at first appeared to be referring to the target of the weakref, not to the weakref itself. The weakref may alias to something that is static or not (the whole point is being able

Re: weakref and static

2005-12-02 Thread John David Anglin
Unfortunately, it can't do that; Mach-O (on Darwin) doesn't support aliases in the object file at all, and even ELF doesn't support aliases to symbols outside the current .o. The easiest solution to this is to require that weakrefs must be 'static', because the name that they define is not

weakref and static

2005-12-01 Thread Geoffrey Keating
be used. It is an error if @samp{__f} is not defined in the same translation unit. @@ -2376,12 +2376,12 @@ @code{weakref} is equivalent to @code{weak}. @smallexample -extern int x() __attribute__ ((weakref (y))); +static int x() __attribute__ ((weakref (y))); /* is equivalent to... */ -extern