Closed as not planned
Description
Bug report
An error occurred when I use gcc12 to compile python3.7.0
the error is as following:
/Python-3.7.0/Modules/_tkinter.c: In function ‘_tkinter_tkapp_loadtk_impl’:
/Python-3.7.0/Modules/_tkinter.c:234:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
234 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate;
| ^~
/Python-3.7.0/Modules/_tkinter.c:2955:5: note: in expansion of macro ‘ENTER_TCL’
2955 | ENTER_TCL
| ^~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:227:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
227 | (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
| ^
/Python-3.7.0/Modules/_tkinter.c:234:57: note: in expansion of macro ‘tcl_tstate’
234 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate;
| ^~~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:2955:5: note: in expansion of macro ‘ENTER_TCL’
2955 | ENTER_TCL
| ^~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c: In function ‘Tkapp_Dealloc’:
/Python-3.7.0/Modules/_tkinter.c:234:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
234 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate;
| ^~
/Python-3.7.0/Modules/_tkinter.c:3018:5: note: in expansion of macro ‘ENTER_TCL’
3018 | ENTER_TCL
| ^~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:227:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
227 | (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
| ^
/Python-3.7.0/Modules/_tkinter.c:234:57: note: in expansion of macro ‘tcl_tstate’
234 | if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate;
| ^~~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:3018:5: note: in expansion of macro ‘ENTER_TCL’
3018 | ENTER_TCL
| ^~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:238:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
238 | if(tcl_lock)PyThread_release_lock(tcl_lock); Py_END_ALLOW_THREADS}
| ^~
/Python-3.7.0/Modules/_tkinter.c:3020:5: note: in expansion of macro ‘LEAVE_TCL’
3020 | LEAVE_TCL
| ^~~~~~~~~
./Include/ceval.h:216:33: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
216 | #define Py_END_ALLOW_THREADS PyEval_RestoreThread(_save); \
| ^~~~~~~~~~~~~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:238:50: note: in expansion of macro ‘Py_END_ALLOW_THREADS’
238 | if(tcl_lock)PyThread_release_lock(tcl_lock); Py_END_ALLOW_THREADS}
| ^~~~~~~~~~~~~~~~~~~~
/Python-3.7.0/Modules/_tkinter.c:3020:5: note: in expansion of macro ‘LEAVE_TCL’
3020 | LEAVE_TCL
| ^~~~~~~~~
+ make altinstall
/bin/sh: line 7: 21347 Segmentation fault (core dumped) LD_LIBRARY_PATH=/Python-3.7.0:/usr/local/ssl/lib:/opt/rh/devtoolset-2/root/usr/lib64:/opt/rh/devtoolset-2/root/usr/lib:/usr/local/lib64:/usr/local/lib:/usr/local/nvidia/lib:/usr/local/nvidia/lib64 ./python -E -m ensurepip $ensurepip --root=/
make: *** [altinstall] Error 139
Your environment
python3.7.0
gcc12.2.0
- CPython versions tested on:
- Operating system and architecture: