summaryrefslogtreecommitdiff
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:56:18 +0100
commit7b76f4ade1b7db0075e07d1a2cadc1ee5954e602 (patch)
treeab7689943afbe38404de3529fbc737eb7816ffea
parentc36bbd66c359edbae74afa955c2eb4f6f615f4a4 (diff)
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. (cherry picked from commit fc4552d3912f2fc99690c6d0c08cb7f16c6d336f)
-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 fb8d3f584..5bcc34b42 100644
--- a/shared/nm-utils/nm-macros-internal.h
+++ b/shared/nm-utils/nm-macros-internal.h
@@ -161,6 +161,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)