You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MODULE test;
TYPE
something* = POINTER TO RECORD
length-: LONGINT; (* current length of string excluding 0X *)
bufferSize: LONGINT; (* {bufferSize >= InitialSize} *)
END;
END test.
MODULE test2;
IMPORT test;
VAR
s: test.something;
BEGIN
NEW(s);
END test2.
NEW generates wrong code here, so
$ voc -s test.Mod test2.Mod -m
test.Mod Compiling test. New symbol file. 471 chars.
test2.Mod Compiling test2. Main program. 453 chars.
In file included from test2.c:8:
test2.c: In function ‘main’:
test2.c:29:17: error: ‘test2__1__typ’ undeclared (first use in this function); did you mean ‘test__1__typ’?
29 | __NEW(test2_s, test2__1);
| ^~~~~~~~
/opt/voc/2/include/SYSTEM.h:280:51: note: in definition of macro ‘__NEW’
280 | #define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ)
| ^
test2.c:29:17: note: each undeclared identifier is reported only once for each function it appears in
29 | __NEW(test2_s, test2__1);
| ^~~~~~~~
/opt/voc/2/include/SYSTEM.h:280:51: note: in definition of macro ‘__NEW’
280 | #define __NEW(p, t) p = Heap_NEWREC((ADDRESS)t##__typ)
| ^
C compile and link: gcc -fPIC -g -I "/opt/voc/2/include" test2.c test.o -o test2 -L"/opt/voc/lib" -lvoc-O2
-- failed: status 0, exitcode 1.
Terminated by Halt(1).
the workaround is using POINTER TO somethingDesc and then having somethingDesc to be the same as POINTER TO RECORD now.
still, this is a bug.
The text was updated successfully, but these errors were encountered:
NEW generates wrong code here, so
the workaround is using
POINTER TO somethingDesc
and then havingsomethingDesc
to be the same as POINTER TO RECORD now.still, this is a bug.
The text was updated successfully, but these errors were encountered: