From 78cff68ca3dcd1d1fb389fe097304a62a756b45c Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Mon, 13 May 2013 12:43:08 +0100 Subject: [PATCH] Workaround issue with clang and inline functions with static vars 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 --- tests/vircgroupmock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/vircgroupmock.c b/tests/vircgroupmock.c index 17ea75f024..f1a5700c6a 100644 --- a/tests/vircgroupmock.c +++ b/tests/vircgroupmock.c @@ -37,7 +37,12 @@ static int (*realaccess)(const char *path, int mode); static int (*reallstat)(const char *path, struct stat *sb); static int (*real__lxstat)(int ver, const char *path, struct stat *sb); static int (*realmkdir)(const char *path, mode_t mode); -static char *fakesysfsdir; + +/* Don't make static, since it causes problems with clang + * when passed as an arg to asprintf() + * vircgroupmock.c:462:22: error: static variable 'fakesysfsdir' is used in an inline function with external linkage [-Werror,-Wstatic-in-inline] + */ +char *fakesysfsdir; # define SYSFS_PREFIX "/not/really/sys/fs/cgroup/" -- 2.39.5