[libvirt] [PATCH 2/6] Workaround issue with clang and inline functions with static vars

Eric Blake eblake at redhat.com
Mon May 13 19:26:06 UTC 2013


On 05/13/2013 06:17 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Clang does not like it when you pass a static variable to an
> inline function
> 
>  vircgroupmock.c:462:22: error: static variable 'fakesysfsdir' is
>   used in an inline function with external linkage [-Werror,-Wstatic-in-inline]
> 
> Just make the var non-static to avoid this
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  tests/vircgroupmock.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

ACK.  I don't know if that is a case where gcc is silently allowing a
non-conforming extension beyond C99, or whether it is a case of clang
just being brain-dead; but either way, the workaround is painless enough
that I don't mind the wider visibility.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130513/f3dd1614/attachment-0001.sig>


More information about the libvir-list mailing list