build: disable warnings where macros expand to tautological comparisons
This commit is contained in:
@@ -29,7 +29,7 @@ if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
|||||||
-fno-strict-aliasing -Wno-unused-but-set-variable \
|
-fno-strict-aliasing -Wno-unused-but-set-variable \
|
||||||
-Wundef -Wimplicit-function-declaration \
|
-Wundef -Wimplicit-function-declaration \
|
||||||
-Wpointer-arith -Winit-self \
|
-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)
|
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"
|
CFLAGS="$CFLAGS_MORE_WARNINGS $CFLAGS_EXTRA $(printf '%s' "$option" | sed 's/^-Wno-/-W/') $CFLAGS_SAVED"
|
||||||
AC_MSG_CHECKING([whether gcc understands $option])
|
AC_MSG_CHECKING([whether gcc understands $option])
|
||||||
|
@@ -116,11 +116,13 @@ typedef enum { /*< skip >*/
|
|||||||
/* log a message for an object (with providing a generic @self pointer) */
|
/* log a message for an object (with providing a generic @self pointer) */
|
||||||
#define nm_log_ptr(level, domain, self, ...) \
|
#define nm_log_ptr(level, domain, self, ...) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
|
NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare") \
|
||||||
if ((level) <= LOGL_DEBUG) { \
|
if ((level) <= LOGL_DEBUG) { \
|
||||||
_nm_log_ptr ((level), (domain), (self), __VA_ARGS__); \
|
_nm_log_ptr ((level), (domain), (self), __VA_ARGS__); \
|
||||||
} else { \
|
} else { \
|
||||||
nm_log ((level), (domain), __VA_ARGS__); \
|
nm_log ((level), (domain), __VA_ARGS__); \
|
||||||
} \
|
} \
|
||||||
|
NM_PRAGMA_WARNING_REENABLE \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
||||||
|
|
||||||
|
@@ -257,6 +257,7 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
|
nmtst_init_with_logging (&argc, &argv, NULL, "ALL");
|
||||||
|
|
||||||
|
NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
|
||||||
if (SETUP == nm_linux_platform_setup && getuid() != 0) {
|
if (SETUP == nm_linux_platform_setup && getuid() != 0) {
|
||||||
/* Try to exec as sudo, this function does not return, if a sudo-cmd is set. */
|
/* Try to exec as sudo, this function does not return, if a sudo-cmd is set. */
|
||||||
nmtst_reexec_sudo ();
|
nmtst_reexec_sudo ();
|
||||||
@@ -269,6 +270,7 @@ main (int argc, char **argv)
|
|||||||
return 77;
|
return 77;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
NM_PRAGMA_WARNING_REENABLE
|
||||||
|
|
||||||
SETUP ();
|
SETUP ();
|
||||||
|
|
||||||
|
@@ -365,12 +365,14 @@ test_bridge (void)
|
|||||||
static void
|
static void
|
||||||
test_bond (void)
|
test_bond (void)
|
||||||
{
|
{
|
||||||
|
NM_PRAGMA_WARNING_DISABLE("-Wtautological-compare")
|
||||||
if (SETUP == nm_linux_platform_setup &&
|
if (SETUP == nm_linux_platform_setup &&
|
||||||
!g_file_test ("/proc/1/net/bonding", G_FILE_TEST_IS_DIR) &&
|
!g_file_test ("/proc/1/net/bonding", G_FILE_TEST_IS_DIR) &&
|
||||||
system("modprobe --show bonding") != 0) {
|
system("modprobe --show bonding") != 0) {
|
||||||
g_test_skip ("Skipping test for bonding: bonding module not available");
|
g_test_skip ("Skipping test for bonding: bonding module not available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
NM_PRAGMA_WARNING_REENABLE
|
||||||
|
|
||||||
test_software (NM_LINK_TYPE_BOND, "bond");
|
test_software (NM_LINK_TYPE_BOND, "bond");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user