json-c 0.16 has the attribute 'cold' used in json_object.c

ports-gcc doesn't understand this and so the use of -Werror makes the
build abort.

This diff adds a patch to strip out 'cold' since it is documented as an
optimization anyway.

The other possible approach would be to turn off '-Werror', but I figured
this is probably more palatable.

ok?

--Kurt

Index: patches/patch-json_object_c
===================================================================
RCS file: patches/patch-json_object_c
diff -N patches/patch-json_object_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-json_object_c 20 Jul 2022 04:14:06 -0000
@@ -0,0 +1,17 @@
+This optimization breaks for ports-gcc. Patch it out.
+
+Index: json_object.c
+--- json_object.c.orig
++++ json_object.c
+@@ -145,10 +145,7 @@ static json_object_to_json_string_fn _json_object_user
+ #elif defined(__OS400__)
+ #define JSON_NORETURN
+ #else
+-/* 'cold' attribute is for optimization, telling the computer this code
+- * path is unlikely.
+- */
+-#define JSON_NORETURN __attribute__((noreturn, cold))
++#define JSON_NORETURN __attribute__((noreturn))
+ #endif
+ #endif
+ /**

Reply via email to