From bcad5ddd38c5184910844d718ca3bb4bae50c47d Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Sat, 11 Mar 2017 22:08:31 +0200 Subject: Only enable -Wmissing-field-initializers for Clang The following pragma is Clang specific: It produces a warning: warning: ignoring #pragma clang diagnostic [-Wunknown-pragmas] Only enable it for Clang by checking the __clang__ macro. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- core/cochran.c | 2 ++ core/datatrak.c | 2 ++ core/equipment.c | 2 ++ core/git-access.c | 2 ++ core/libdivecomputer.c | 2 ++ core/load-git.c | 2 ++ core/membuffer.c | 2 ++ core/parse-xml.c | 2 ++ core/save-git.c | 2 ++ core/save-html.c | 2 ++ core/save-xml.c | 2 ++ core/worldmap-save.c | 2 ++ 12 files changed, 24 insertions(+) (limited to 'core') diff --git a/core/cochran.c b/core/cochran.c index c31e78f79..430c3b48a 100644 --- a/core/cochran.c +++ b/core/cochran.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/datatrak.c b/core/datatrak.c index 6c9b00764..272aa3424 100644 --- a/core/datatrak.c +++ b/core/datatrak.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/equipment.c b/core/equipment.c index 0d4ab5571..19b50ab69 100644 --- a/core/equipment.c +++ b/core/equipment.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif /* equipment.c */ #include diff --git a/core/git-access.c b/core/git-access.c index b95606d86..ac4ac80af 100644 --- a/core/git-access.c +++ b/core/git-access.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/libdivecomputer.c b/core/libdivecomputer.c index 8ffb49d43..f8f9823c2 100644 --- a/core/libdivecomputer.c +++ b/core/libdivecomputer.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/load-git.c b/core/load-git.c index 03e7f8694..fdac2ef8c 100644 --- a/core/load-git.c +++ b/core/load-git.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/membuffer.c b/core/membuffer.c index 053edb8f0..e35f160b2 100644 --- a/core/membuffer.c +++ b/core/membuffer.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/parse-xml.c b/core/parse-xml.c index 38cd25f05..2f5be06bc 100644 --- a/core/parse-xml.c +++ b/core/parse-xml.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/save-git.c b/core/save-git.c index d0ae790fa..cfcd3627c 100644 --- a/core/save-git.c +++ b/core/save-git.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/save-html.c b/core/save-html.c index 0b2d8e79a..2824625ef 100644 --- a/core/save-html.c +++ b/core/save-html.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include "save-html.h" #include "qthelperfromc.h" diff --git a/core/save-xml.c b/core/save-xml.c index c9b6a5b99..b6a0e4b81 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include diff --git a/core/worldmap-save.c b/core/worldmap-save.c index e7e8bcc30..8ad6535ba 100644 --- a/core/worldmap-save.c +++ b/core/worldmap-save.c @@ -1,5 +1,7 @@ +#ifdef __clang__ // Clang has a bug on zero-initialization of C structs. #pragma clang diagnostic ignored "-Wmissing-field-initializers" +#endif #include #include -- cgit v1.2.3-70-g09d2