]> git.proxmox.com Git - mirror_lxc.git/commitdiff
clang: Fix build warnings for 3.4
authorStéphane Graber <stgraber@ubuntu.com>
Wed, 30 Apr 2014 16:15:06 +0000 (12:15 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 30 Apr 2014 17:02:15 +0000 (13:02 -0400)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/log.h
src/lxc/lxc_autostart.c
src/lxc/lxc_start.c
src/lxc/lxccontainer.c

index 5252869a679df4b08208112acd58d945b4556cfb..d9f3ebc2352260196d1fc0508e9eb8efaf7fdc59 100644 (file)
 #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,                      \
index ec9d9ba838eb609dfb4c5e55215b2b05234f01a4..1e0c6085816b56d5542e1ecc814840b30799150d 100644 (file)
@@ -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))
index 157bea924b4345bf5d10a1216a0538b2a02c411a..9b47e8cd19b3d02661d92b0554e2dcb38a3e67b6 100644 (file)
@@ -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;
 
index c90b564f8b882510a95baed196c40e14b83f2a42..270b8fc2a3bb28b57460138fe6ed0e8461b53aa7 100644 (file)
@@ -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 */