]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
json-c: Fix function prototypes
authorKhem Raj <raj.khem@gmail.com>
Sun, 14 Aug 2022 22:20:28 +0000 (15:20 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 16 Aug 2022 13:55:47 +0000 (14:55 +0100)
This is flagged with clang 15

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/json-c/json-c/0001-Fix-build-with-clang-15.patch [new file with mode: 0644]
meta/recipes-devtools/json-c/json-c_0.16.bb

diff --git a/meta/recipes-devtools/json-c/json-c/0001-Fix-build-with-clang-15.patch b/meta/recipes-devtools/json-c/json-c/0001-Fix-build-with-clang-15.patch
new file mode 100644 (file)
index 0000000..215f4d8
--- /dev/null
@@ -0,0 +1,34 @@
+From 0145b575ac1fe6a77e00d639864f26fc91ceb12f Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Sat, 13 Aug 2022 20:37:03 -0700
+Subject: [PATCH] Fix build with clang-15+
+
+Fixes
+json_util.c:63:35: error: a function declaration without a prototype is deprecated in all versions of C [-We
+rror,-Wstrict-prototypes]
+const char *json_util_get_last_err()
+                                  ^
+                                   void
+
+Upstream-Status: Backport [https://github.com/json-c/json-c/pull/783]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ json_util.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/json_util.c b/json_util.c
+index 952770a..83d9c68 100644
+--- a/json_util.c
++++ b/json_util.c
+@@ -60,7 +60,7 @@ static int _json_object_to_fd(int fd, struct json_object *obj, int flags, const
+ static char _last_err[256] = "";
+-const char *json_util_get_last_err()
++const char *json_util_get_last_err(void)
+ {
+       if (_last_err[0] == '\0')
+               return NULL;
+-- 
+2.37.2
+
index 50431081bba9fe1ef2fa923d2fa968e8c2cf55ec..3aba41dfcf64d138c787c032c5ec4d49a049fa55 100644 (file)
@@ -6,9 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=de54b60fbbc35123ba193fea8ee216f2"
 
 SRC_URI = " \
     https://s3.amazonaws.com/json-c_releases/releases/${BP}.tar.gz \
+    file://0001-Fix-build-with-clang-15.patch \
     file://run-ptest \
 "
-
 SRC_URI[sha256sum] = "8e45ac8f96ec7791eaf3bb7ee50e9c2100bbbc87b8d0f1d030c5ba8a0288d96b"
 
 UPSTREAM_CHECK_URI = "https://github.com/${BPN}/${BPN}/tags"