json-c uses the attribute 'cold' in one place for optimization.

ports-gcc doesn't know it so warns. So we need to disable using
-Werror in order to fix the build on sparc64

ok jca@
This commit is contained in:
kmos 2022-07-21 17:33:51 +00:00
parent b7e9b666b8
commit 76979e1714
2 changed files with 19 additions and 0 deletions

View File

@ -14,4 +14,6 @@ MASTER_SITES = https://s3.amazonaws.com/json-c_releases/releases/
MODULES= devel/cmake
CONFIGURE_ARGS= -DDISABLE_WERROR=ON
.include <bsd.port.mk>

View File

@ -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
/**