From 2b73f04e230eead40dac91ed8d9fa054a85c8883 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Wed, 8 Apr 2020 22:54:19 -0500 Subject: [PATCH 1/2] Cast pointers to quiet -Wformat-pedantic warnings --- Objects/object.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Objects/object.c b/Objects/object.c index ef4ba997de4273..b35f696260ad01 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -349,7 +349,7 @@ _PyObject_Dump(PyObject* op) if (_PyObject_IsFreed(op)) { /* It seems like the object memory has been freed: don't access it to prevent a segmentation fault. */ - fprintf(stderr, "\n", op); + fprintf(stderr, "\n", (const void *)op); fflush(stderr); return; } @@ -362,7 +362,7 @@ _PyObject_Dump(PyObject* op) fflush(stderr); PyTypeObject *type = Py_TYPE(op); - fprintf(stderr, "object type : %p\n", type); + fprintf(stderr, "object type : %p\n", (const void *)type); fprintf(stderr, "object type name: %s\n", type==NULL ? "NULL" : type->tp_name); @@ -2168,7 +2168,7 @@ _PyObject_AssertFailed(PyObject *obj, const char *expr, const char *msg, if (_PyObject_IsFreed(obj)) { /* It seems like the object memory has been freed: don't access it to prevent a segmentation fault. */ - fprintf(stderr, "\n", obj); + fprintf(stderr, "\n", (const void *)obj); fflush(stderr); } else { From a07bbd296bf39373779978240b1849453984b610 Mon Sep 17 00:00:00 2001 From: Andy Lester Date: Wed, 8 Apr 2020 23:07:11 -0500 Subject: [PATCH 2/2] Cast pointers to quiet -Wformat-pedantic warnings --- Python/pylifecycle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/pylifecycle.c b/Python/pylifecycle.c index 9b413c631875ae..a4d817254210f0 100644 --- a/Python/pylifecycle.c +++ b/Python/pylifecycle.c @@ -2167,7 +2167,7 @@ fatal_error_dump_runtime(FILE *stream, _PyRuntimeState *runtime) fprintf(stream, "Python runtime state: "); PyThreadState *finalizing = _PyRuntimeState_GetFinalizing(runtime); if (finalizing) { - fprintf(stream, "finalizing (tstate=%p)", finalizing); + fprintf(stream, "finalizing (tstate=%p)", (const void *)finalizing); } else if (runtime->initialized) { fprintf(stream, "initialized");