提交 78cff68c 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
上级 c43b685a
......@@ -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/"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册