The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/3384

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
From 64a2547c0a1be819e8e6f6aeb40c58af93648770 Mon Sep 17 00:00:00 2001
From: Christian Brauner <christian.brau...@ubuntu.com>
Date: Wed, 15 Apr 2020 21:27:53 +0200
Subject: [PATCH] travis: coverity gets confused about the %m printf extension
 in glibc

Signed-off-by: Christian Brauner <christian.brau...@ubuntu.com>
---
 .travis.yml   |  2 +-
 configure.ac  |  5 +++++
 src/lxc/log.h | 16 ++++++++--------
 3 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index b3050fe2b6..2d41aaaa7a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -37,6 +37,6 @@ addons:
     # Where email notification of build analysis results will be sent
     notification_email: christian.brau...@ubuntu.com
 
-    build_command_prepend: "./autogen.sh && mkdir build && cd build && 
../configure --enable-tests --with-distro=unknown --disable-rpath 
--enable-tests --enable-memfd-rexec --enable-seccomp --enable-static 
--enable-werror"
+    build_command_prepend: "./autogen.sh && mkdir build && cd build && 
../configure --enable-coverity-build --enable-tests --with-distro=unknown 
--disable-rpath --enable-tests --enable-memfd-rexec --enable-seccomp 
--enable-static --enable-werror"
     build_command: "make -j4"
     branch_pattern: master
diff --git a/configure.ac b/configure.ac
index fdc57493ca..232c6315e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -767,6 +767,11 @@ AC_ARG_ENABLE([thread-safety],
        [enable_thread_safety=$enableval], [enable_thread_safety=yes])
 AM_CONDITIONAL([ENFORCE_THREAD_SAFETY], [test "x$enable_thread_safety" = 
"xyes"])
 
+AC_ARG_ENABLE([coverity-build],
+       [AS_HELP_STRING([--enable-coverity-build], [handle coverity builds 
[default=no]])],
+       [enable_coverity_build=$enableval], [enable_coverity_build=yes])
+AM_CONDITIONAL([ENABLE_COVERITY_BUILD], [test "x$enable_coverity_build" = 
"xyes"])
+
 AC_ARG_ENABLE([dlog],
        [AS_HELP_STRING([--enable-dlog], [enable dlog support [default=no]])],
        [enable_dlog=$enableval], [enable_dlog=no])
diff --git a/src/lxc/log.h b/src/lxc/log.h
index 881e97130d..a8d27bdde0 100644
--- a/src/lxc/log.h
+++ b/src/lxc/log.h
@@ -391,7 +391,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        LXC_FATAL(&locinfo, format, ##__VA_ARGS__);                     \
 } while (0)
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define SYSTRACE(format, ...)                              \
                TRACE("%m - " format, ##__VA_ARGS__)
 #else
@@ -402,7 +402,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        } while (0)
 #endif
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define SYSDEBUG(format, ...)                              \
                 DEBUG("%m - " format, ##__VA_ARGS__)
 #else
@@ -414,7 +414,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
 #endif
 
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define SYSINFO(format, ...)                              \
                 INFO("%m - " format, ##__VA_ARGS__)
 #else
@@ -425,7 +425,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        } while (0)
 #endif
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define SYSNOTICE(format, ...)                              \
                NOTICE("%m - " format, ##__VA_ARGS__)
 #else
@@ -436,7 +436,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        } while (0)
 #endif
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define SYSWARN(format, ...)                              \
                WARN("%m - " format, ##__VA_ARGS__)
 #else
@@ -447,7 +447,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        } while (0)
 #endif
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define SYSERROR(format, ...)                              \
                ERROR("%m - " format, ##__VA_ARGS__)
 #else
@@ -458,7 +458,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        } while (0)
 #endif
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define CMD_SYSERROR(format, ...)                                             \
        fprintf(stderr, "%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, \
                __func__, ##__VA_ARGS__);
@@ -471,7 +471,7 @@ __lxc_unused static inline void LXC_##LEVEL(struct 
lxc_log_locinfo* locinfo,        \
        } while (0)
 #endif
 
-#if HAVE_M_FORMAT
+#if HAVE_M_FORMAT && !ENABLE_COVERITY_BUILD
 #define CMD_SYSINFO(format, ...)                                               
\
        printf("%s: %d: %s - %m - " format "\n", __FILE__, __LINE__, __func__, \
               ##__VA_ARGS__);
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to