]> granicus.if.org Git - python/commitdiff
bpo-33182: Fix pointer types in _testembed (GH-6310) (GH-6311)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 30 Mar 2018 06:24:03 +0000 (23:24 -0700)
committerNick Coghlan <ncoghlan@gmail.com>
Fri, 30 Mar 2018 06:24:03 +0000 (16:24 +1000)
(cherry picked from commit 69f5c73311a61b05485b19626935bf240ad31c5b)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
Misc/NEWS.d/next/Build/2018-03-30-14-55-48.bpo-33182.CePczb.rst [new file with mode: 0644]
Programs/_testembed.c

diff --git a/Misc/NEWS.d/next/Build/2018-03-30-14-55-48.bpo-33182.CePczb.rst b/Misc/NEWS.d/next/Build/2018-03-30-14-55-48.bpo-33182.CePczb.rst
new file mode 100644 (file)
index 0000000..6310e5d
--- /dev/null
@@ -0,0 +1 @@
+The embedding tests can once again be built with clang 6.0
index 09b7bf6d94fc8ae35e5eef0ed3c869fff454ddb2..7406470ae65c58a968a587ff91e7a16dbd3f4f99 100644 (file)
@@ -166,16 +166,18 @@ static int test_pre_initialization_api(void)
 /* bpo-33042: Ensure embedding apps can predefine sys module options */
 static int test_pre_initialization_sys_options(void)
 {
-    /* We allocate a couple of the option dynamically, and then delete
+    /* We allocate a couple of the options dynamically, and then delete
      * them before calling Py_Initialize. This ensures the interpreter isn't
      * relying on the caller to keep the passed in strings alive.
      */
-    wchar_t *static_warnoption = L"once";
-    wchar_t *static_xoption = L"also_not_an_option=2";
+    const wchar_t *static_warnoption = L"once";
+    const wchar_t *static_xoption = L"also_not_an_option=2";
     size_t warnoption_len = wcslen(static_warnoption);
     size_t xoption_len = wcslen(static_xoption);
-    wchar_t *dynamic_once_warnoption = calloc(warnoption_len+1, sizeof(wchar_t));
-    wchar_t *dynamic_xoption = calloc(xoption_len+1, sizeof(wchar_t));
+    wchar_t *dynamic_once_warnoption = \
+             (wchar_t *) calloc(warnoption_len+1, sizeof(wchar_t));
+    wchar_t *dynamic_xoption = \
+             (wchar_t *) calloc(xoption_len+1, sizeof(wchar_t));
     wcsncpy(dynamic_once_warnoption, static_warnoption, warnoption_len+1);
     wcsncpy(dynamic_xoption, static_xoption, xoption_len+1);