summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-03-18 18:09:08 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-03-19 11:48:49 +0100
commit3ccc6f290d356098d80db4628aaf0034a96b8f56 (patch)
tree72436501ea78ac3e8f82fed15e8b292520550c8e
parenta43f95b0ac2292d17d0d9e20cda40d0136620152 (diff)
downloadNetworkManager-3ccc6f290d356098d80db4628aaf0034a96b8f56.tar.gz
build: disable warnings where macros expand to tautological comparisons
-rw-r--r--m4/compiler_warnings.m42
-rw-r--r--src/nm-logging.h2
-rw-r--r--src/platform/tests/test-common.c2
-rw-r--r--src/platform/tests/test-link.c2
4 files changed, 7 insertions, 1 deletions
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
index 412acb9750..05bc9a0663 100644
--- a/m4/compiler_warnings.m4
+++ b/m4/compiler_warnings.m4
@@ -29,7 +29,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
-fno-strict-aliasing -Wno-unused-but-set-variable \
-Wundef -Wimplicit-function-declaration \
-Wpointer-arith -Winit-self \
- -Wmissing-include-dirs; do
+ -Wmissing-include-dirs -Wno-pragmas; do
dnl GCC 4.4 does not warn when checking for -Wno-* flags (https://gcc.gnu.org/wiki/FAQ#wnowarning)
CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_EXTRA $(printf '%s' "$option" | sed 's/^-Wno-/-W/') $CFLAGS_SAVED"
AC_MSG_CHECKING([whether gcc understands $option])
diff --git a/src/nm-logging.h b/src/nm-logging.h
index 7417dfa0f7..4ae9c02687 100644
--- a/src/nm-logging.h
+++ b/src/nm-logging.h
@@ -116,11 +116,13 @@ typedef enum { /*< skip >*/
/* log a message for an object (with providing a generic @self pointer) */
#define nm_log_ptr(level, domain, self, ...) \
G_STMT_START { \
+ NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare") \
if ((level) <= LOGL_DEBUG) { \
_nm_log_ptr ((level), (domain), (self), __VA_ARGS__); \
} else { \
nm_log ((level), (domain), __VA_ARGS__); \
} \
+ NM_PRAGMA_WARNING_REENABLE \
} G_STMT_END
diff --git a/src/platform/tests/test-common.c b/src/platform/tests/test-common.c
index 3e716bf8c9..d8e8775f82 100644
--- a/src/platform/tests/test-common.c
+++ b/src/platform/tests/test-common.c
@@ -257,6 +257,7 @@ main (int argc, char **argv)
nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
+ NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
if (SETUP == nm_linux_platform_setup && getuid() != 0) {
/* Try to exec as sudo, this function does not return, if a sudo-cmd is set. */
nmtst_reexec_sudo ();
@@ -269,6 +270,7 @@ main (int argc, char **argv)
return 77;
#endif
}
+ NM_PRAGMA_WARNING_REENABLE
SETUP ();
diff --git a/src/platform/tests/test-link.c b/src/platform/tests/test-link.c
index 8bd2ef44d4..ec4f9ba203 100644
--- a/src/platform/tests/test-link.c
+++ b/src/platform/tests/test-link.c
@@ -365,12 +365,14 @@ test_bridge (void)
static void
test_bond (void)
{
+ NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
if (SETUP == nm_linux_platform_setup &&
!g_file_test ("/proc/1/net/bonding", G_FILE_TEST_IS_DIR) &&
system("modprobe --show bonding") != 0) {
g_test_skip ("Skipping test for bonding: bonding module not available");
return;
}
+ NM_PRAGMA_WARNING_REENABLE
test_software (NM_LINK_TYPE_BOND, "bond");
}