This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix build break with single-threaded Python library
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 17 Feb 2010 16:00:20 +0100 (CET)
- Subject: [commit] Fix build break with single-threaded Python library
Hello,
when building GDB against a private single-threaded Python installation,
compilation failed with warnings like:
/home/uweigand/fsf/gdb-head/gdb/python/python.c: In function "restore_python_env":
/home/uweigand/fsf/gdb-head/gdb/python/python.c:84: warning: statement with no effect
/home/uweigand/fsf/gdb-head/gdb/python/python.c: In function "source_python_script":
/home/uweigand/fsf/gdb-head/gdb/python/python.c:359: warning: statement with no effect
/home/uweigand/fsf/gdb-head/gdb/python/python.c: In function "initialize_python":
/home/uweigand/fsf/gdb-head/gdb/python/python.c:689: warning: statement with no effect
Fixed by the following patch; committed to mainline as obvious.
Bye,
Ulrich
ChangeLog:
* python/python-internal.h [!WITH_THREAD] (PyGILState_Release,
PyThreadState_Swap): Avoid "statement with no effect" warning.
Index: gdb/python/python-internal.h
===================================================================
RCS file: /cvs/src/src/gdb/python/python-internal.h,v
retrieving revision 1.17
diff -c -p -r1.17 python-internal.h
*** gdb/python/python-internal.h 10 Jul 2009 10:35:17 -0000 1.17
--- gdb/python/python-internal.h 8 Feb 2010 15:16:05 -0000
*************** typedef int Py_ssize_t;
*** 54,62 ****
PyGILState_STATE will be. */
#ifndef WITH_THREAD
#define PyGILState_Ensure() ((PyGILState_STATE) 0)
! #define PyGILState_Release(ARG) (ARG)
#define PyEval_InitThreads() 0
! #define PyThreadState_Swap(ARG) (ARG)
#define PyEval_InitThreads() 0
#define PyEval_ReleaseLock() 0
#endif
--- 54,62 ----
PyGILState_STATE will be. */
#ifndef WITH_THREAD
#define PyGILState_Ensure() ((PyGILState_STATE) 0)
! #define PyGILState_Release(ARG) ((void)(ARG))
#define PyEval_InitThreads() 0
! #define PyThreadState_Swap(ARG) ((void)(ARG))
#define PyEval_InitThreads() 0
#define PyEval_ReleaseLock() 0
#endif
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com