On 2 November 2012 14:14, Paolo Bonzini <pbonz...@redhat.com> wrote:
> Weakrefs only tell you if the symbol was defined elsewhere, so you
> need a further check at runtime to pick the default definition
> when needed.
>
> This could be automated by the compiler, but it does not do it.

clang doesn't error out anymore, but this version still provokes
a warning:

  CC    osdep.o
osdep.c:85:1: warning: unused function
'weak_monitor_fdset_dup_fd_find' [-Wunused-function]
QEMU_WEAK_ALIAS(monitor_fdset_dup_fd_find, default_fdset_dup_fd_find);
^
./compiler.h:55:32: note: expanded from macro 'QEMU_WEAK_ALIAS'
        static typeof(oldname) weak_##newname __attribute__((weakref(#oldname)))
                               ^
<scratch space>:147:1: note: expanded from macro 'weak_'
weak_monitor_fdset_dup_fd_find
^
1 warning generated.

-- PMM

Reply via email to