summaryrefslogtreecommitdiff
path: root/src/scanner.c
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2014-02-15 13:29:16 -0500
committerKristian Høgsberg <krh@bitplanet.net>2014-02-18 14:28:08 -0800
commit859b3e41f5529fefee5a5f866f257f8ae5def950 (patch)
tree66229919d79024d280923086b7654ace159c81cd /src/scanner.c
parentac188e9e44f5f852ec6163d269979f725ce73b57 (diff)
downloadwayland-859b3e41f5529fefee5a5f866f257f8ae5def950.tar.gz
scanner: Add GCC pragmas to disable -Wredundant-decls
The code very intentionally emits a lot of redundant declarations to simplify the scanner code. Somebody building with -Wredundant-decls would have compile errors, so emit special pragmas to turn those warnings off. These pragmas should be ignored outside of gcc/clang.
Diffstat (limited to 'src/scanner.c')
-rw-r--r--src/scanner.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scanner.c b/src/scanner.c
index 243ddfd..e8bfc7c 100644
--- a/src/scanner.c
+++ b/src/scanner.c
@@ -1165,11 +1165,13 @@ emit_code(struct protocol *protocol)
"#include <stdint.h>\n"
"#include \"wayland-util.h\"\n\n");
+ printf("#pragma GCC diagnostic push\n"
+ "#pragma GCC diagnostic ignored \"-Wredundant-decls\"\n");
wl_list_for_each(i, &protocol->interface_list, link) {
emit_types_forward_declarations(protocol, &i->request_list);
emit_types_forward_declarations(protocol, &i->event_list);
}
- printf("\n");
+ printf("#pragma GCC diagnostic pop\n\n");
printf("static const struct wl_interface *types[] = {\n");
emit_null_run(protocol);