summaryrefslogtreecommitdiffstats
path: root/Modules/faulthandler.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2012-10-30 23:33:57 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2012-10-30 23:33:57 (GMT)
commit56cb12542d7ea5c95b9483e3db69388bcbc2ffbb (patch)
tree2c66f16414127cfe2dcd99e1a9af08eb83ee8de9 /Modules/faulthandler.c
parent4ca1cf35fbf042700dfeaf7bf27d3d476eff32a6 (diff)
downloadcpython-56cb12542d7ea5c95b9483e3db69388bcbc2ffbb.zip
cpython-56cb12542d7ea5c95b9483e3db69388bcbc2ffbb.tar.gz
cpython-56cb12542d7ea5c95b9483e3db69388bcbc2ffbb.tar.bz2
Issue #9566: Explicit downcast to fix compiler warnings on Win64
Diffstat (limited to 'Modules/faulthandler.c')
-rw-r--r--Modules/faulthandler.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/faulthandler.c b/Modules/faulthandler.c
index b0df93c..f49993d 100644
--- a/Modules/faulthandler.c
+++ b/Modules/faulthandler.c
@@ -22,7 +22,9 @@
# define FAULTHANDLER_USER
#endif
-#define PUTS(fd, str) write(fd, str, strlen(str))
+/* cast size_t to int because write() takes an int on Windows
+ (anyway, the length is smaller than 30 characters) */
+#define PUTS(fd, str) write(fd, str, (int)strlen(str))
#ifdef HAVE_SIGACTION
typedef struct sigaction _Py_sighandler_t;
@@ -445,7 +447,7 @@ faulthandler_thread(void *unused)
/* get the thread holding the GIL, NULL if no thread hold the GIL */
current = _Py_atomic_load_relaxed(&_PyThreadState_Current);
- write(thread.fd, thread.header, thread.header_len);
+ write(thread.fd, thread.header, (int)thread.header_len);
errmsg = _Py_DumpTracebackThreads(thread.fd, thread.interp, current);
ok = (errmsg == NULL);