Commit 670566f0d45a6dc623860d7365b0493b7fa92986

Ran Benita 2019-12-27T15:03:10

Only add GCC diagnostic pragmas when compiler is GCC compatible Avoid "unknown pragma" warnings on other compilers. Signed-off-by: Ran Benita <ran@unusedvar.com>

diff --git a/scripts/makekeys b/scripts/makekeys
index 4732f8d..f6a0280 100755
--- a/scripts/makekeys
+++ b/scripts/makekeys
@@ -17,8 +17,10 @@ print('''
 entry_offsets = {}
 
 print('''
+#ifdef __GNUC__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Woverlength-strings"
+#endif
 static const char *keysym_names =
 '''.strip())
 offs = 0
@@ -28,7 +30,9 @@ for (name, _) in sorted(entries, key=lambda e: e[0].lower()):
     offs += len(name) + 1
 print('''
 ;
+#ifdef __GNUC__
 #pragma GCC diagnostic pop
+#endif
 '''.strip())
 
 print('''
diff --git a/src/ks_tables.h b/src/ks_tables.h
index a6db8de..dde7bde 100644
--- a/src/ks_tables.h
+++ b/src/ks_tables.h
@@ -5,8 +5,10 @@
  * https://raw.github.com/xkbcommon/libxkbcommon/master/src/ks_tables.h
  */
 
+#ifdef __GNUC__
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Woverlength-strings"
+#endif
 static const char *keysym_names =
     "0\0"
     "1\0"
@@ -2417,7 +2419,9 @@ static const char *keysym_names =
     "Zstroke\0"
     "zstroke\0"
 ;
+#ifdef __GNUC__
 #pragma GCC diagnostic pop
+#endif
 
 struct name_keysym {
     xkb_keysym_t keysym;
diff --git a/test/log.c b/test/log.c
index 4a93a6e..384fabc 100644
--- a/test/log.c
+++ b/test/log.c
@@ -26,7 +26,9 @@
 #include "test.h"
 #include "context.h"
 
+#ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wmissing-format-attribute"
+#endif
 
 static const char *
 log_level_to_string(enum xkb_log_level level)
diff --git a/xkbcommon/xkbcommon-keysyms.h b/xkbcommon/xkbcommon-keysyms.h
index ad18c87..4af795c 100644
--- a/xkbcommon/xkbcommon-keysyms.h
+++ b/xkbcommon/xkbcommon-keysyms.h
@@ -111,11 +111,11 @@ SOFTWARE.
  * When adding new keysyms to this file, do not forget to also update the
  * following as needed:
  *
- *   - the mappings in src/KeyBind.c in the repo
- *     git://anongit.freedesktop.org/xorg/lib/libX11.git
+ *   - the mappings in src/KeyBind.c in the libX11 repo
+ *     https://gitlab.freedesktop.org/xorg/lib/libx11
  *
- *   - the protocol specification in specs/keysyms.xml
- *     in the repo git://anongit.freedesktop.org/xorg/proto/x11proto.git
+ *   - the protocol specification in specs/keysyms.xml in this repo
+ *     https://gitlab.freedesktop.org/xorg/proto/xorgproto
  *
  */