Commit 13aad0ae by Stéphane Graber

clang: Fix build warnings for 3.4

parent 9e607c2f
...@@ -44,6 +44,13 @@ ...@@ -44,6 +44,13 @@
#define LXC_LOG_PREFIX_SIZE 32 #define LXC_LOG_PREFIX_SIZE 32
#define LXC_LOG_BUFFER_SIZE 512 #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. */ /* predefined priorities. */
enum lxc_loglevel { enum lxc_loglevel {
LXC_LOG_PRIORITY_TRACE, LXC_LOG_PRIORITY_TRACE,
...@@ -180,10 +187,10 @@ __lxc_log(const struct lxc_log_category* category, ...@@ -180,10 +187,10 @@ __lxc_log(const struct lxc_log_category* category,
*/ */
#define lxc_log_priority_define(acategory, PRIORITY) \ #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))); \ 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, ...) \ const char* format, ...) \
{ \ { \
if (lxc_log_priority_is_enabled(acategory, \ if (lxc_log_priority_is_enabled(acategory, \
......
...@@ -220,7 +220,7 @@ int main(int argc, char *argv[]) ...@@ -220,7 +220,7 @@ int main(int argc, char *argv[])
struct lxc_list *it, *next; struct lxc_list *it, *next;
char *const default_start_args[] = { char *const default_start_args[] = {
"/sbin/init", "/sbin/init",
'\0', NULL,
}; };
if (lxc_arguments_parse(&my_args, argc, argv)) if (lxc_arguments_parse(&my_args, argc, argv))
......
...@@ -207,7 +207,7 @@ int main(int argc, char *argv[]) ...@@ -207,7 +207,7 @@ int main(int argc, char *argv[])
char *rcfile = NULL; char *rcfile = NULL;
char *const default_args[] = { char *const default_args[] = {
"/sbin/init", "/sbin/init",
'\0', NULL,
}; };
struct lxc_container *c; struct lxc_container *c;
......
...@@ -555,7 +555,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv ...@@ -555,7 +555,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv
FILE *pid_fp = NULL; FILE *pid_fp = NULL;
char *default_args[] = { char *default_args[] = {
"/sbin/init", "/sbin/init",
'\0', NULL,
}; };
/* container exists */ /* container exists */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment