1 From 6eca65617aacd19f4928acd5766b8dd20eda0b34 Mon Sep 17 00:00:00 2001
2 From: Khem Raj <raj.khem@gmail.com>
3 Date: Sat, 13 Aug 2022 20:37:03 -0700
4 Subject: [PATCH] Fix build with clang-15+
7 json_util.c:63:35: error: a function declaration without a prototype is deprecated in all versions of C [-We
8 rror,-Wstrict-prototypes]
9 const char *json_util_get_last_err()
13 Signed-off-by: Khem Raj <raj.khem@gmail.com>
16 tests/test1.c | 6 +++---
18 tests/test_cast.c | 2 +-
19 tests/test_charcase.c | 2 +-
20 tests/test_parse.c | 8 ++++----
21 tests/test_printbuf.c | 4 ++--
22 tests/test_util_file.c | 6 +++---
23 8 files changed, 16 insertions(+), 16 deletions(-)
27 @@ -60,7 +60,7 @@ static int _json_object_to_fd(int fd, st
29 static char _last_err[256] = "";
31 -const char *json_util_get_last_err()
32 +const char *json_util_get_last_err(void)
34 if (_last_err[0] == '\0')
38 @@ -58,7 +58,7 @@ static const char *to_json_string(json_o
41 json_object *make_array(void);
42 -json_object *make_array()
43 +json_object *make_array(void)
45 json_object *my_array;
47 @@ -74,7 +74,7 @@ json_object *make_array()
50 void test_array_del_idx(void);
51 -void test_array_del_idx()
52 +void test_array_del_idx(void)
56 @@ -140,7 +140,7 @@ void test_array_del_idx()
59 void test_array_list_expand_internal(void);
60 -void test_array_list_expand_internal()
61 +void test_array_list_expand_internal(void)
67 @@ -28,7 +28,7 @@ void print_hex(const char *s)
70 static void test_lot_of_adds(void);
71 -static void test_lot_of_adds()
72 +static void test_lot_of_adds(void)
76 --- a/tests/test_cast.c
77 +++ b/tests/test_cast.c
78 @@ -94,7 +94,7 @@ static void getit(struct json_object *ne
79 printf("new_obj.%s json_object_get_double()=%f\n", field, json_object_get_double(o));
82 -static void checktype_header()
83 +static void checktype_header(void)
85 printf("json_object_is_type: %s,%s,%s,%s,%s,%s,%s\n", json_type_to_name(json_type_null),
86 json_type_to_name(json_type_boolean), json_type_to_name(json_type_double),
87 --- a/tests/test_charcase.c
88 +++ b/tests/test_charcase.c
89 @@ -19,7 +19,7 @@ int main(int argc, char **argv)
92 /* make sure only lowercase forms are parsed in strict mode */
93 -static void test_case_parse()
94 +static void test_case_parse(void)
96 struct json_tokener *tok;
98 --- a/tests/test_parse.c
99 +++ b/tests/test_parse.c
100 @@ -92,7 +92,7 @@ static void single_basic_parse(const cha
101 if (getenv("TEST_PARSE_CHUNKSIZE") != NULL)
102 single_incremental_parse(test_string, clear_serializer);
104 -static void test_basic_parse()
105 +static void test_basic_parse(void)
107 single_basic_parse("\"\003\"", 0);
108 single_basic_parse("/* hello */\"foo\"", 0);
109 @@ -195,7 +195,7 @@ static void test_basic_parse()
110 single_basic_parse("[18446744073709551616]", 1);
113 -static void test_utf8_parse()
114 +static void test_utf8_parse(void)
116 // json_tokener_parse doesn't support checking for byte order marks.
117 // It's the responsibility of the caller to detect and skip a BOM.
118 @@ -222,7 +222,7 @@ static int clear_serializer(json_object
119 return JSON_C_VISIT_RETURN_CONTINUE;
122 -static void test_verbose_parse()
123 +static void test_verbose_parse(void)
125 json_object *new_obj;
126 enum json_tokener_error error = json_tokener_success;
127 @@ -562,7 +562,7 @@ struct incremental_step
128 {NULL, -1, -1, json_tokener_success, 0},
131 -static void test_incremental_parse()
132 +static void test_incremental_parse(void)
134 json_object *new_obj;
135 enum json_tokener_error jerr;
136 --- a/tests/test_printbuf.c
137 +++ b/tests/test_printbuf.c
138 @@ -16,7 +16,7 @@ static void test_printbuf_memset_length(
139 #define __func__ __FUNCTION__
142 -static void test_basic_printbuf_memset()
143 +static void test_basic_printbuf_memset(void)
147 @@ -29,7 +29,7 @@ static void test_basic_printbuf_memset()
148 printf("%s: end test\n", __func__);
151 -static void test_printbuf_memset_length()
152 +static void test_printbuf_memset_length(void)
156 --- a/tests/test_util_file.c
157 +++ b/tests/test_util_file.c
158 @@ -35,7 +35,7 @@ static void test_read_fd_equal(const cha
162 -static void test_write_to_file()
163 +static void test_write_to_file(void)
167 @@ -231,7 +231,7 @@ static void test_read_valid_nested_with_
171 -static void test_read_nonexistant()
172 +static void test_read_nonexistant(void)
174 const char *filename = "./not_present.json";
176 @@ -249,7 +249,7 @@ static void test_read_nonexistant()
180 -static void test_read_closed()
181 +static void test_read_closed(void)
183 // Test reading from a closed fd
184 int d = open("/dev/null", O_RDONLY, 0);