Has anyone a fix for this rather curious bug? - it seems subranges, packed records and VAR arguments conspire to make the compiler throw a bogus error!?
Thanks for any help.
SamL
-------8<---------
program foo; { Using a subrange type in a packed recrod seems to break passing the type by reference } type t1 = 0..100; {Has to be subrange}
r1 = packed record { Has to be packed } f1 : t1; end;
procedure proc1(var a1: t1); { Has to be var } external;
procedure proc2(var a1: t1); { Also has to be var } begin proc1(a1); end;
begin end. -------8<---------
Reading specs from /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.8.1/specs gpc version 19980830, based on gcc-2.8.1 /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.8.1/gpc-cpp -lang-pascal -v -nocharescape -undef -D__GNUC__=2 -D__GNUC_MINOR__=8 -D__GPC__=2 -D__GPC_MINOR__=0 -D__GPC_RELEASE__=19980830 -D__ELF__ -Dunix -Dlinux -D__ELF__ -D__unix__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -Di386 -Di586 -Asystem(unix) -Acpu(i386) -Amachine(i386) -D__i386 -D__i586 -Asystem(unix) -Acpu(i386) -Amachine(i386) foo.pas /tmp/cca16201.i GNU CPP version 2.8.1 (i386 GNU/Linux with ELF) #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/local/i586-pc-linux-gnu/include /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.8.1/include /usr/include End of search list. /usr/local/lib/gcc-lib/i586-pc-linux-gnu/2.8.1/gpc1 /tmp/cca16201.i -quiet -dumpbase foo.pas -version -famtmpfile=foo.gpc -o /tmp/cca16201.s GNU Pascal version 2.8.1 (i586-pc-linux-gnu) compiled by GNU C version 2.7.2.3. foo.pas: In function `Proc2': foo.pas:19: type mismatch in argument 1 of `Proc1' foo.pas:19: passing arg 1 of `Proc1' from incompatible pointer type