From: Stéphane Graber Date: Wed, 30 Apr 2014 16:15:06 +0000 (-0400) Subject: clang: Fix build warnings for 3.4 X-Git-Tag: lxc-1.1.0.alpha1~132 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13aad0ae78b39a481f4c3f465a525264747cc92a;p=thirdparty%2Flxc.git clang: Fix build warnings for 3.4 Signed-off-by: Stéphane Graber --- diff --git a/src/lxc/log.h b/src/lxc/log.h index 5252869a6..d9f3ebc23 100644 --- a/src/lxc/log.h +++ b/src/lxc/log.h @@ -44,6 +44,13 @@ #define LXC_LOG_PREFIX_SIZE 32 #define LXC_LOG_BUFFER_SIZE 512 +/* This attribute is required to silence clang warnings */ +#if defined(__GNUC__) +#define ATTR_UNUSED __attribute__ ((unused)) +#else +#define ATTR_UNUSED +#endif + /* predefined priorities. */ enum lxc_loglevel { LXC_LOG_PRIORITY_TRACE, @@ -180,10 +187,10 @@ __lxc_log(const struct lxc_log_category* category, */ #define lxc_log_priority_define(acategory, PRIORITY) \ \ -static inline void LXC_##PRIORITY(struct lxc_log_locinfo *, \ +ATTR_UNUSED static inline void LXC_##PRIORITY(struct lxc_log_locinfo *, \ const char *, ...) __attribute__ ((format (printf, 2, 3))); \ \ -static inline void LXC_##PRIORITY(struct lxc_log_locinfo* locinfo, \ +ATTR_UNUSED static inline void LXC_##PRIORITY(struct lxc_log_locinfo* locinfo, \ const char* format, ...) \ { \ if (lxc_log_priority_is_enabled(acategory, \ diff --git a/src/lxc/lxc_autostart.c b/src/lxc/lxc_autostart.c index ec9d9ba83..1e0c60858 100644 --- a/src/lxc/lxc_autostart.c +++ b/src/lxc/lxc_autostart.c @@ -220,7 +220,7 @@ int main(int argc, char *argv[]) struct lxc_list *it, *next; char *const default_start_args[] = { "/sbin/init", - '\0', + NULL, }; if (lxc_arguments_parse(&my_args, argc, argv)) diff --git a/src/lxc/lxc_start.c b/src/lxc/lxc_start.c index 157bea924..9b47e8cd1 100644 --- a/src/lxc/lxc_start.c +++ b/src/lxc/lxc_start.c @@ -207,7 +207,7 @@ int main(int argc, char *argv[]) char *rcfile = NULL; char *const default_args[] = { "/sbin/init", - '\0', + NULL, }; struct lxc_container *c; diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index c90b564f8..270b8fc2a 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -555,7 +555,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv FILE *pid_fp = NULL; char *default_args[] = { "/sbin/init", - '\0', + NULL, }; /* container exists */