vishapoberon / compiler

vishap oberon compiler
http://oberon.vishap.am
GNU General Public License v3.0
186 stars 25 forks source link

Undecl var fix #74

Closed norayr closed 4 years ago

norayr commented 4 years ago

there are still warnings while compiling Oleg's test.

MODULE Test;

TYPE
T1 = ARRAY 5 OF REAL;
T2 = ARRAY 5 OF T1;

PROCEDURE Do4 ( x: ARRAY OF ARRAY OF REAL );
END Do4;

PROCEDURE Do3 ( x: ARRAY OF T1 );
BEGIN
  Do4( x );
END Do3;

END Test.

now it compiles with the following warnings:

test.Mod  Compiling Test.  Main program.  694 chars.
Test.c: In function ‘Test_Do3’:
Test.c:32:11: warning: passing argument 1 of ‘Test_Do4’ from incompatible pointer type [-Wincompatible-pointer-types]
   32 |  Test_Do4(x, x__len, 5);
      |           ^
      |           |
      |           REAL (*)[5] {aka float (*)[5]}
Test.c:23:29: note: expected ‘REAL *’ {aka ‘float *’} but argument is of type ‘REAL (*)[5]’ {aka ‘float (*)[5]’}
   23 | static void Test_Do4 (REAL *x, ADDRESS x__len, ADDRESS x__len1)

@dcwbrown also, see my new email.

dcwbrown commented 4 years ago

Looks good to me, Thanks.