37 lines
1.6 KiB
Diff
37 lines
1.6 KiB
Diff
|
From 4253aefd5b5bf5f68177b37b73588ed83d05ac7e Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
||
|
Date: Thu, 2 Jul 2020 19:29:04 +0200
|
||
|
Subject: [PATCH] Fix PyVTKAddFile_* function signature mismatch
|
||
|
|
||
|
The implementation generated in vtkWrapPython.c has void return type, as
|
||
|
noted by GCC when using LTO, e.g.:
|
||
|
--
|
||
|
./build/CMakeFiles/vtkRenderingOpenGL2PythonPython/vtkRenderingOpenGL2PythonInitImpl.cxx:85:24: warning: 'PyVTKAddFile_vtkPointFillPass' violates the C++ One Definition Rule [-Wodr]
|
||
|
85 | extern "C" { PyObject *PyVTKAddFile_vtkPointFillPass(PyObject *dict); }
|
||
|
| ^
|
||
|
./build/CMakeFiles/vtkRenderingOpenGL2Python/vtkPointFillPassPython.cxx:442:6: note: return value type mismatch
|
||
|
442 | void PyVTKAddFile_vtkPointFillPass(
|
||
|
| ^
|
||
|
./build/CMakeFiles/vtkRenderingOpenGL2Python/vtkPointFillPassPython.cxx:442:6: note: 'PyVTKAddFile_vtkPointFillPass' was previously declared here
|
||
|
--
|
||
|
---
|
||
|
Wrapping/Tools/vtkWrapPythonInit.c | 2 +-
|
||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/Wrapping/Tools/vtkWrapPythonInit.c b/Wrapping/Tools/vtkWrapPythonInit.c
|
||
|
index 6b108c1aca..dcccd4cf5d 100644
|
||
|
--- a/Wrapping/Tools/vtkWrapPythonInit.c
|
||
|
+++ b/Wrapping/Tools/vtkWrapPythonInit.c
|
||
|
@@ -61,7 +61,7 @@ static void CreateImplFile(const char* libName, const char* importName, int numD
|
||
|
|
||
|
for (i = 0; i < numFiles; i++)
|
||
|
{
|
||
|
- fprintf(fout, "extern \"C\" { PyObject *PyVTKAddFile_%s(PyObject *dict); }\n", files[i]);
|
||
|
+ fprintf(fout, "extern \"C\" { void PyVTKAddFile_%s(PyObject *dict); }\n", files[i]);
|
||
|
}
|
||
|
|
||
|
fprintf(fout, "\nstatic PyMethodDef Py%s_Methods[] = {\n", libName);
|
||
|
--
|
||
|
2.27.0
|
||
|
|