Thread
Commits
-
jit: Fix warning reported by gcc-11 caused by dubious function signature.
- 082d9d6b576b 13.3 landed
- 7f2e10baa248 14.0 landed
-
gcc 11.1.0 warnings in llvmjit_expr.c
Erik Rijkers <er@xs4all.nl> — 2021-04-28T22:07:01Z
Hello, gcc 11.1.0 produces quite a litany of second thoughts when compiling llvmjit_expr.c; is there something in it? (all 'warning' or 'note') llvmjit_expr.c: In function ‘llvm_compile_expr’: llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1553:33: note: in expansion of macro ‘build_EvalXFunc’ 1553 | build_EvalXFunc(b, mod, "ExecEvalSQLValueFunction", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1553:33: note: in expansion of macro ‘build_EvalXFunc’ 1553 | build_EvalXFunc(b, mod, "ExecEvalSQLValueFunction", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1559:33: note: in expansion of macro ‘build_EvalXFunc’ 1559 | build_EvalXFunc(b, mod, "ExecEvalCurrentOfExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1559:33: note: in expansion of macro ‘build_EvalXFunc’ 1559 | build_EvalXFunc(b, mod, "ExecEvalCurrentOfExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1565:33: note: in expansion of macro ‘build_EvalXFunc’ 1565 | build_EvalXFunc(b, mod, "ExecEvalNextValueExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1565:33: note: in expansion of macro ‘build_EvalXFunc’ 1565 | build_EvalXFunc(b, mod, "ExecEvalNextValueExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1571:33: note: in expansion of macro ‘build_EvalXFunc’ 1571 | build_EvalXFunc(b, mod, "ExecEvalArrayExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1571:33: note: in expansion of macro ‘build_EvalXFunc’ 1571 | build_EvalXFunc(b, mod, "ExecEvalArrayExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1583:33: note: in expansion of macro ‘build_EvalXFunc’ 1583 | build_EvalXFunc(b, mod, "ExecEvalRow", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1583:33: note: in expansion of macro ‘build_EvalXFunc’ 1583 | build_EvalXFunc(b, mod, "ExecEvalRow", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1738:33: note: in expansion of macro ‘build_EvalXFunc’ 1738 | build_EvalXFunc(b, mod, "ExecEvalMinMax", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1738:33: note: in expansion of macro ‘build_EvalXFunc’ 1738 | build_EvalXFunc(b, mod, "ExecEvalMinMax", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1816:33: note: in expansion of macro ‘build_EvalXFunc’ 1816 | build_EvalXFunc(b, mod, "ExecEvalConstraintNotNull", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1816:33: note: in expansion of macro ‘build_EvalXFunc’ 1816 | build_EvalXFunc(b, mod, "ExecEvalConstraintNotNull", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1822:33: note: in expansion of macro ‘build_EvalXFunc’ 1822 | build_EvalXFunc(b, mod, "ExecEvalConstraintCheck", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1822:33: note: in expansion of macro ‘build_EvalXFunc’ 1822 | build_EvalXFunc(b, mod, "ExecEvalConstraintCheck", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1834:33: note: in expansion of macro ‘build_EvalXFunc’ 1834 | build_EvalXFunc(b, mod, "ExecEvalScalarArrayOp", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1834:33: note: in expansion of macro ‘build_EvalXFunc’ 1834 | build_EvalXFunc(b, mod, "ExecEvalScalarArrayOp", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1846:33: note: in expansion of macro ‘build_EvalXFunc’ 1846 | build_EvalXFunc(b, mod, "ExecEvalXmlExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1846:33: note: in expansion of macro ‘build_EvalXFunc’ 1846 | build_EvalXFunc(b, mod, "ExecEvalXmlExpr", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: warning: ‘build_EvalXFuncInt’ accessing 8 bytes in a region of size 0 [-Wstringop-overflow=] 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1872:33: note: in expansion of macro ‘build_EvalXFunc’ 1872 | build_EvalXFunc(b, mod, "ExecEvalGroupingFunc", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:69:9: note: referencing argument 7 of type ‘struct LLVMOpaqueValue **’ 69 | build_EvalXFuncInt(b, mod, funcname, v_state, op, \ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 70 | lengthof(((LLVMValueRef[]){__VA_ARGS__})), \ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 71 | ((LLVMValueRef[]){__VA_ARGS__})) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvmjit_expr.c:1872:33: note: in expansion of macro ‘build_EvalXFunc’ 1872 | build_EvalXFunc(b, mod, "ExecEvalGroupingFunc", | ^~~~~~~~~~~~~~~ llvmjit_expr.c:2460:1: note: in a call to function ‘build_EvalXFuncInt’ 2460 | build_EvalXFuncInt(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, | ^~~~~~~~~~~~~~~~~~ Erik Rijkers -
Re: gcc 11.1.0 warnings in llvmjit_expr.c
Andres Freund <andres@anarazel.de> — 2021-05-06T05:30:44Z
Hi, On 2021-04-29 00:07:01 +0200, Erik Rijkers wrote: > gcc 11.1.0 produces quite a litany of second thoughts when compiling llvmjit_expr.c; is there something in it? They're wrong, but I can see why it warns - the signature choice was weird. Pushed the fix to 13 and master. Greetings, Andres Freund
-
Re: gcc 11.1.0 warnings in llvmjit_expr.c
Andres Freund <andres@anarazel.de> — 2021-05-06T05:31:40Z
On 2021-05-05 22:30:44 -0700, Andres Freund wrote: > On 2021-04-29 00:07:01 +0200, Erik Rijkers wrote: > > gcc 11.1.0 produces quite a litany of second thoughts when compiling llvmjit_expr.c; is there something in it? > > They're wrong, but I can see why it warns - the signature choice was > weird. Pushed the fix to 13 and master. Oh, and thanks for the report....