]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
Fix function prototypes in deep nesting test (clang compilation) 925/head
authorMilan Broz <gmazyland@gmail.com>
Tue, 12 May 2026 19:33:14 +0000 (21:33 +0200)
committerMilan Broz <gmazyland@gmail.com>
Tue, 12 May 2026 19:46:50 +0000 (21:46 +0200)
This patch fixes the build error with clang-21
  tests/test_deep_nesting.c:19:34: error: a function declaration
  without a prototype is deprecated in all versions of C
  [-Werror,-Wstrict-prototypes]
   19 | static char *generate_json_string()

by fixing generate_json_string() definition.

It also removes prototypes for static functions that are not needed.

tests/test_deep_nesting.c

index 90fa1966a93c4dc7a7f1f694f9a087a40bac5287..364c4820ea5dfa42e66ea3ccfee7c9eec5da8c5f 100644 (file)
@@ -15,8 +15,7 @@
 
 #define NESTING_DEPTH 100000
 
-static char *generate_json_string(void);
-static char *generate_json_string()
+static char *generate_json_string(void)
 {
        char *str;
        int depth = NESTING_DEPTH;
@@ -27,7 +26,6 @@ static char *generate_json_string()
        return str;
 }
 
-static void test_deep_nesting_put(const char *str);
 static void test_deep_nesting_put(const char *str)
 {
        json_object *my_array;
@@ -42,7 +40,6 @@ static void test_deep_nesting_put(const char *str)
        json_tokener_free(tok);
 }
 
-static void test_deep_nesting_tostring(const char *str);
 static void test_deep_nesting_tostring(const char *str)
 {
        json_object *my_array;