makekeys: Add a gcc pragma to ignore -Woverlength-strings
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
diff --git a/makekeys.py b/makekeys.py
index 4cb4282..1939912 100644
--- a/makekeys.py
+++ b/makekeys.py
@@ -16,13 +16,20 @@ print('''
entry_offsets = {}
-print('const char *keysym_names =')
+print('''
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverlength-strings"
+const char *keysym_names =
+'''.strip())
offs = 0
for (name, _) in sorted(entries, key=lambda e: e[0].lower()):
entry_offsets[name] = offs
print(' "{name}\\0"'.format(name=name))
offs += len(name) + 1
-print(';')
+print('''
+;
+#pragma GCC diagnostic pop
+'''.strip())
print('''
struct name_keysym {
diff --git a/src/ks_tables.h b/src/ks_tables.h
index c4d3c45..2955f8d 100644
--- a/src/ks_tables.h
+++ b/src/ks_tables.h
@@ -5,6 +5,8 @@
* https://raw.github.com/xkbcommon/libxkbcommon/master/src/ks_tables.h
*/
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Woverlength-strings"
const char *keysym_names =
"0\0"
"1\0"
@@ -2409,6 +2411,7 @@ const char *keysym_names =
"Zstroke\0"
"zstroke\0"
;
+#pragma GCC diagnostic pop
struct name_keysym {
xkb_keysym_t keysym;