diff options
| author | Lubomir Rintel <lkundrak@v3.sk> | 2018-01-23 14:31:39 +0100 |
|---|---|---|
| committer | Lubomir Rintel <lkundrak@v3.sk> | 2018-01-24 09:56:18 +0100 |
| commit | 40a50599499e5b44181d084d90302593e1e89ce6 (patch) | |
| tree | ab7689943afbe38404de3529fbc737eb7816ffea | |
| parent | b2b28cb644f179496dcaeb248f58a8bf307a2593 (diff) | |
| download | NetworkManager-40a50599499e5b44181d084d90302593e1e89ce6.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.
(cherry picked from commit fc4552d3912f2fc99690c6d0c08cb7f16c6d336f)
| -rw-r--r-- | shared/nm-utils/nm-macros-internal.h | 1 |
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 fb8d3f5840..5bcc34b420 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) |
