Commit e00666d5 by Stéphane Graber

clang: Fix build warnings for 3.4

parent 1a255d79
......@@ -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, \
......
......@@ -217,7 +217,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))
......
......@@ -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;
......
......@@ -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 */
......
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