Browse Source

* convert array declarations without size into pointers (as even the comment in the code says), resolves #10156

git-svn-id: trunk@15860 -
florian 15 năm trước cách đây
mục cha
commit
782643789b

+ 2 - 2
utils/h2pas/h2pas.pas

@@ -2781,7 +2781,7 @@ begin
          yyval:=hp;
          yyval:=hp;
          while assigned(hp^.p1) do
          while assigned(hp^.p1) do
          hp:=hp^.p1;
          hp:=hp^.p1;
-         hp^.p1:=new(presobject,init_two(t_arraydef,nil,nil));
+         hp^.p1:=new(presobject,init_one(t_pointerdef,nil));
          
          
        end;
        end;
  109 : begin
  109 : begin
@@ -2857,7 +2857,7 @@ begin
          yyval:=hp;
          yyval:=hp;
          while assigned(hp^.p1) do
          while assigned(hp^.p1) do
          hp:=hp^.p1;
          hp:=hp^.p1;
-         hp^.p1:=new(presobject,init_two(t_arraydef,nil,nil));
+         hp^.p1:=new(presobject,init_one(t_pointerdef,nil));
          
          
        end;
        end;
  119 : begin
  119 : begin

+ 2 - 2
utils/h2pas/h2pas.y

@@ -2658,7 +2658,7 @@ declarator :
        $$:=hp;
        $$:=hp;
        while assigned(hp^.p1) do
        while assigned(hp^.p1) do
          hp:=hp^.p1;
          hp:=hp^.p1;
-       hp^.p1:=new(presobject,init_two(t_arraydef,nil,nil));
+       hp^.p1:=new(presobject,init_one(t_pointerdef,nil));
      } |
      } |
      LKLAMMER declarator RKLAMMER
      LKLAMMER declarator RKLAMMER
      {
      {
@@ -2726,7 +2726,7 @@ abstract_declarator :
        $$:=hp;
        $$:=hp;
        while assigned(hp^.p1) do
        while assigned(hp^.p1) do
          hp:=hp^.p1;
          hp:=hp^.p1;
-       hp^.p1:=new(presobject,init_two(t_arraydef,nil,nil));
+       hp^.p1:=new(presobject,init_one(t_pointerdef,nil));
      } |
      } |
      LKLAMMER abstract_declarator RKLAMMER
      LKLAMMER abstract_declarator RKLAMMER
      {
      {

+ 4 - 1
utils/h2pas/testit.h

@@ -93,4 +93,7 @@ typedef struct FnTable {
   int (*Fn1)( void );
   int (*Fn1)( void );
   int (*Fn2)( void );
   int (*Fn2)( void );
   int (*Fn3)( void );
   int (*Fn3)( void );
-} FnTable;
+} FnTable;
+
+
+void f(int a, char* p[]);