]> granicus.if.org Git - python/commitdiff
don't put runtime values in array initializer for C89 compliance (closes #20588)
authorBenjamin Peterson <benjamin@python.org>
Tue, 11 Feb 2014 03:19:02 +0000 (22:19 -0500)
committerBenjamin Peterson <benjamin@python.org>
Tue, 11 Feb 2014 03:19:02 +0000 (22:19 -0500)
Misc/NEWS
Parser/asdl_c.py
Python/Python-ast.c

index edefb80163fbf1551efd3acb404eb07aff2bf7e6..ac1ba0da2ba6a9299202707888be963f43db7cea 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -10,6 +10,8 @@ What's New in Python 3.3.5 release candidate 1?
 Core and Builtins
 -----------------
 
+- Issue #20588: Make Python-ast.c C89 compliant.
+
 - Issue #20437: Fixed 21 potential bugs when deleting objects references.
 
 - Issue #20538: UTF-7 incremental decoder produced inconsistant string when
index 0b6c88cc7b68b3fba773e51f7931ca186452eaca..4b84e0fd6b2a222bea86aec680e7b620e2fe1843 100755 (executable)
@@ -1150,10 +1150,14 @@ PyObject* PyAST_mod2obj(mod_ty t)
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
 {
     mod_ty res;
-    PyObject *req_type[] = {(PyObject*)Module_type, (PyObject*)Expression_type,
-                            (PyObject*)Interactive_type};
+    PyObject *req_type[3];
     char *req_name[] = {"Module", "Expression", "Interactive"};
     int isinstance;
+
+    req_type[0] = (PyObject*)Module_type;
+    req_type[1] = (PyObject*)Expression_type;
+    req_type[2] = (PyObject*)Interactive_type;
+
     assert(0 <= mode && mode <= 2);
 
     init_types();
index 7bf2c5092d3f31e93147ca2a25f41399fdde302b..aa032338af76832a415606647c72e579aa1b6579 100644 (file)
@@ -6957,10 +6957,14 @@ PyObject* PyAST_mod2obj(mod_ty t)
 mod_ty PyAST_obj2mod(PyObject* ast, PyArena* arena, int mode)
 {
     mod_ty res;
-    PyObject *req_type[] = {(PyObject*)Module_type, (PyObject*)Expression_type,
-                            (PyObject*)Interactive_type};
+    PyObject *req_type[3];
     char *req_name[] = {"Module", "Expression", "Interactive"};
     int isinstance;
+    
+    req_type[0] = (PyObject*)Module_type;
+    req_type[1] = (PyObject*)Expression_type;
+    req_type[2] = (PyObject*)Interactive_type;
+    
     assert(0 <= mode && mode <= 2);
 
     init_types();