LLVM C API has an incorrect prototype in <llvm-c/Transforms/PassBuilder.h>
that compilers complain about with -Wstrict-prototypes.

/usr/local/include/llvm-c/Transforms/PassBuilder.h:53:55: error: this function 
declaration is not a prototype [-Werror,-Wstrict-prototypes]
LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions();
                                                      ^
                                                       void
1 error generated.

This has been fixed in upstream
llvm-project commit 2f53fcc831e2f5ceee0d42c41766d9231049e46b.

The header fix could be applied to OpenBSD base system as well.
However, the error does not show up there because clang appears
to apply some implicit/legacy C rules to headers under /usr/include.

Index: Makefile
===================================================================
RCS file: ports/devel/llvm/Makefile,v
retrieving revision 1.298
diff -u -p -r1.298 Makefile
--- Makefile    23 Jul 2023 19:22:00 -0000      1.298
+++ Makefile    3 Sep 2023 04:44:13 -0000
@@ -15,7 +15,7 @@ PKGNAME =     llvm-${LLVM_V}
 PKGSPEC-main = llvm-=${LLVM_V}
 PKGNAME-python =       py3-llvm-${LLVM_V}
 PKGNAME-lldb = lldb-${LLVM_V}
-REVISION-main =        7
+REVISION-main =        8
 REVISION-lldb =        1
 REVISION-python = 0
 
Index: patches/patch-include_llvm-c_Transforms_PassBuilder_h
===================================================================
RCS file: patches/patch-include_llvm-c_Transforms_PassBuilder_h
diff -N patches/patch-include_llvm-c_Transforms_PassBuilder_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-include_llvm-c_Transforms_PassBuilder_h       3 Sep 2023 
04:44:13 -0000
@@ -0,0 +1,12 @@
+Index: include/llvm-c/Transforms/PassBuilder.h
+--- include/llvm-c/Transforms/PassBuilder.h.orig
++++ include/llvm-c/Transforms/PassBuilder.h
+@@ -50,7 +50,7 @@ LLVMErrorRef LLVMRunPasses(LLVMModuleRef M, const char
+  * responsible for it. The client should call LLVMDisposePassBuilderOptions
+  * to free the pass builder options.
+  */
+-LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions();
++LLVMPassBuilderOptionsRef LLVMCreatePassBuilderOptions(void);
+ 
+ /**
+  * Toggle adding the VerifierPass for the PassBuilder, ensuring all functions

Reply via email to