git: 2624cb3dcfc2 - main - textproc/raptor2: fix build with clang 15
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 13 Dec 2022 16:25:28 UTC
The branch main has been updated by dim (src committer):
URL: https://cgit.FreeBSD.org/ports/commit/?id=2624cb3dcfc2581bf64eae4675e96940adfb64da
commit 2624cb3dcfc2581bf64eae4675e96940adfb64da
Author: Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-12-12 16:12:52 +0000
Commit: Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-12-13 16:24:25 +0000
textproc/raptor2: fix build with clang 15
During an exp-run for llvm 15 (see bug 265425), it turned out that
textproc/raptor2 failed to build with clang 15:
raptor_parse.c:260:66: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
^~~~
/usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
#define NULL ((void *)0)
^~~~~~~~~~~
./raptor_internal.h:168:12: note: expanded from macro 'RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE'
return ret; \
^~~
This was fixed in https://github.com/dajobe/raptor/commit/567d4d1a by
upstream.
PR: 268336
Approved by: tcberner (maintainer)
MFH: 2022Q4
---
textproc/raptor2/files/patch-commit-567d4d1a | 47 ++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/textproc/raptor2/files/patch-commit-567d4d1a b/textproc/raptor2/files/patch-commit-567d4d1a
new file mode 100644
index 000000000000..576f85dd91d4
--- /dev/null
+++ b/textproc/raptor2/files/patch-commit-567d4d1a
@@ -0,0 +1,47 @@
+commit 567d4d1ab639d924e8d5af459476f331b9af0ce5
+Author: Dave Beckett <dave@dajobe.org>
+Date: Tue Nov 4 15:25:20 2014 -0800
+
+ Fix error returns in new world methods
+
+ (raptor_world_get_parser_factory,
+ raptor_world_get_serializers_count): Fix return value in assertions
+
+diff --git src/raptor_parse.c src/raptor_parse.c
+index 26911f47..6caa7f1c 100644
+--- src/raptor_parse.c
++++ src/raptor_parse.c
+@@ -252,12 +252,12 @@ raptor_world_get_parser_factory(raptor_world *world, const char *name)
+ *
+ * Get number of parsers
+ *
+- * Return value: number of parsers
++ * Return value: number of parsers or <0 on failure
+ **/
+ int
+ raptor_world_get_parsers_count(raptor_world* world)
+ {
+- RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
++ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1);
+
+ raptor_world_open(world);
+
+diff --git src/raptor_serialize.c src/raptor_serialize.c
+index a1f29d78..a0344418 100644
+--- src/raptor_serialize.c
++++ src/raptor_serialize.c
+@@ -235,12 +235,12 @@ raptor_get_serializer_factory(raptor_world* world, const char *name)
+ *
+ * Get number of serializers
+ *
+- * Return value: number of serializers
++ * Return value: number of serializers or <0 on failure
+ **/
+ int
+ raptor_world_get_serializers_count(raptor_world* world)
+ {
+- RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, NULL);
++ RAPTOR_ASSERT_OBJECT_POINTER_RETURN_VALUE(world, raptor_world, -1);
+
+ raptor_world_open(world);
+