From 508c39ee133d6725a4440ba98a1555e2026975c2 Mon Sep 17 00:00:00 2001 From: Martin Maly Date: Wed, 6 May 2015 13:18:33 -0700 Subject: Resolve compilation errors if compiled with more stringent semantic checks. Adding Travis test to build with strict warnings. Fixing a warning in a test which used signed/unsigned integer comparison. --- upb/json/parser.rl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'upb/json/parser.rl') diff --git a/upb/json/parser.rl b/upb/json/parser.rl index 0379be4..b171617 100644 --- a/upb/json/parser.rl +++ b/upb/json/parser.rl @@ -1084,7 +1084,7 @@ static void end_object(upb_json_parser *p) { main := ws object ws; }%% -%% write data; +%% write data noerror nofinal; size_t parse(void *closure, const void *hd, const char *buf, size_t size, const upb_bufhandle *handle) { @@ -1122,6 +1122,13 @@ error: bool end(void *closure, const void *hd) { UPB_UNUSED(closure); UPB_UNUSED(hd); + + // Prevent compile warning on unused static constants. + UPB_UNUSED(json_start); + UPB_UNUSED(json_en_number_machine); + UPB_UNUSED(json_en_string_machine); + UPB_UNUSED(json_en_value_machine); + UPB_UNUSED(json_en_main); return true; } -- cgit v1.2.3