summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-01-23 14:31:39 +0100
committerLubomir Rintel <lkundrak@v3.sk>2018-01-24 09:53:38 +0100
commitfc4552d3912f2fc99690c6d0c08cb7f16c6d336f (patch)
tree917574ba3e8f9faea9dd94090981f242d17a8baa /shared
parentc93827e404ffd48ba7011a4625bf640d90afaa6a (diff)
downloadNetworkManager-fc4552d3912f2fc99690c6d0c08cb7f16c6d336f.tar.gz
shared/utils: don't warn of unknown warning disables with clang
When pushing a warning disable with clang, always disable -Wunknown-warning-option first -- it might be that clang wouldn't warn of what we're trying to disable because it doesn't recognize it in the first place. That is entierely okay. With clang-5.0.0: CC libnm/tests/libnm_tests_test_secret_agent-test-secret-agent.o In file included from libnm/tests/test-secret-agent.c:29: In file included from ./shared/nm-test-libnm-utils.h:23: ./shared/nm-utils/nm-test-utils.h:432:3: error: unknown warning group '-Wunused-but-set-variable', ignored [-Werror,-Wunknown-warning-option] NM_PRAGMA_WARNING_DISABLE("-Wunused-but-set-variable") ^ ./shared/nm-utils/nm-macros-internal.h:223:9: note: expanded from macro 'NM_PRAGMA_WARNING_DISABLE' _Pragma(_NM_PRAGMA_WARNING_DO(warning)) ^ <scratch space>:204:25: note: expanded from here GCC diagnostic ignored "-Wunused-but-set-variable" ^ 1 error generated.
Diffstat (limited to 'shared')
-rw-r--r--shared/nm-utils/nm-macros-internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/shared/nm-utils/nm-macros-internal.h b/shared/nm-utils/nm-macros-internal.h
index 852a87df5b..5837a47bc7 100644
--- a/shared/nm-utils/nm-macros-internal.h
+++ b/shared/nm-utils/nm-macros-internal.h
@@ -220,6 +220,7 @@ _nm_auto_protect_errno (int *p_saved_errno)
#elif defined (__clang__)
#define NM_PRAGMA_WARNING_DISABLE(warning) \
_Pragma("clang diagnostic push") \
+ _Pragma(_NM_PRAGMA_WARNING_DO("-Wunknown-warning-option")) \
_Pragma(_NM_PRAGMA_WARNING_DO(warning))
#else
#define NM_PRAGMA_WARNING_DISABLE(warning)