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>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
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
*
*/