[perl #42615] [PATCH] C89 doesn't allow non-constant initializers

2007-04-19 Thread via RT
# New Ticket Created by  Andy Dougherty 
# Please include the string:  [perl #42615]
# in the subject line of all future correspondence about this issue. 
# URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42615 


This patch works around the following error message:

src/inter_call.c, line 1350: non-constant initializer: op U
src/inter_call.c, line 1350: non-constant initializer: op U
src/inter_call.c, line 1351: non-constant initializer: op NAME
src/inter_call.c, line 1351: non-constant initializer: op NAME

diff -ru parrot-current/src/inter_call.c parrot-andy/src/inter_call.c
--- parrot-current/src/inter_call.c Sun Apr 15 03:15:15 2007
+++ parrot-andy/src/inter_call.cThu Apr 19 10:26:02 2007
@@ -1347,8 +1347,8 @@
 PMC* save_current_object;
 
 /* temporary state vars for building PCC index and PCC signature arrays. */
-opcode_t *indexes[2] = { arg_indexes, result_indexes };
-PMC *sigs[2] = { args_sig, results_sig };
+opcode_t *indexes[2]; /* = { arg_indexes, result_indexes }; */
+PMC *sigs[2]; /* = { args_sig, results_sig }; */
 int arg_ret_cnt[2] = { 0, 0 }; /* # of arg args, # of result args */
 int max_regs[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; /* INSP args, INSP results */
 int seen_arrow = 0;
@@ -1359,6 +1359,11 @@
 
 va_list list;
 va_start(list, signature);
+
+indexes[0] = arg_indexes;
+indexes[1] = result_indexes;
+sigs[0] = args_sig;
+sigs[1] = results_sig;
 
 /* account for passing invocant in-band */
 if (pmc) {

-- 
Andy Dougherty  [EMAIL PROTECTED]


Re: [perl #42615] [PATCH] C89 doesn't allow non-constant initializers

2007-04-19 Thread Steve Peters
On Thu, Apr 19, 2007 at 11:24:43AM -0700, Andy Dougherty wrote:
 # New Ticket Created by  Andy Dougherty 
 # Please include the string:  [perl #42615]
 # in the subject line of all future correspondence about this issue. 
 # URL: http://rt.perl.org/rt3/Ticket/Display.html?id=42615 
 
 
 This patch works around the following error message:
 
 src/inter_call.c, line 1350: non-constant initializer: op U
 src/inter_call.c, line 1350: non-constant initializer: op U
 src/inter_call.c, line 1351: non-constant initializer: op NAME
 src/inter_call.c, line 1351: non-constant initializer: op NAME
 
 diff -ru parrot-current/src/inter_call.c parrot-andy/src/inter_call.c
 --- parrot-current/src/inter_call.c   Sun Apr 15 03:15:15 2007
 +++ parrot-andy/src/inter_call.c  Thu Apr 19 10:26:02 2007
 @@ -1347,8 +1347,8 @@
  PMC* save_current_object;
  
  /* temporary state vars for building PCC index and PCC signature arrays. 
 */
 -opcode_t *indexes[2] = { arg_indexes, result_indexes };
 -PMC *sigs[2] = { args_sig, results_sig };
 +opcode_t *indexes[2]; /* = { arg_indexes, result_indexes }; */
 +PMC *sigs[2]; /* = { args_sig, results_sig }; */
  int arg_ret_cnt[2] = { 0, 0 }; /* # of arg args, # of result args */
  int max_regs[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; /* INSP args, INSP results 
 */
  int seen_arrow = 0;
 @@ -1359,6 +1359,11 @@
  
  va_list list;
  va_start(list, signature);
 +
 +indexes[0] = arg_indexes;
 +indexes[1] = result_indexes;
 +sigs[0] = args_sig;
 +sigs[1] = results_sig;
  
  /* account for passing invocant in-band */
  if (pmc) {
 

Cool!  I meant to look into this one since it also breaks Borland C++ and
causes warnings under -ansi -pedantic.

Steve Peters
[EMAIL PROTECTED]


Re: [perl #42615] [PATCH] C89 doesn't allow non-constant initializers

2007-04-19 Thread chromatic
On Thursday 19 April 2007 11:24, Andy Dougherty wrote:

 This patch works around the following error message:

 src/inter_call.c, line 1350: non-constant initializer: op U
 src/inter_call.c, line 1350: non-constant initializer: op U
 src/inter_call.c, line 1351: non-constant initializer: op NAME
 src/inter_call.c, line 1351: non-constant initializer: op NAME

Thanks, applied as r18288, with some minor formatting updates.

-- c