Frank,
Thanks for your reply. I've managed to cut down the module to this very short module so I just get two errors, both - prior parameter's size depends on 'A':
MODULE Test interface; export Test=(Test_proc);
PROCEDURE Test_proc(List : ARRAY[a..b :INTEGER] OF DOUBLE); END.
MODULE Test implementation;
PROCEDURE Test_proc;
BEGIN List[a]:= 2.3; List[2]:= 2.3; END; { Test_proc }
END.
The errors correspond to each assignment although the error line is the declaration. Sure enough, converting this to a unit fixes the problem:
UNIT Test;
Interface PROCEDURE Test_proc(List : ARRAY[a..b :INTEGER] OF DOUBLE);
Implementation
PROCEDURE Test_proc;
BEGIN List[a]:= 2.3; List[2]:= 2.3; END; { Test_proc }
END.
Is the module syntax illegal or is it a bug? If it is a bug, at least you can take comfort in knowing it can kill the DEC Pascal compiler too!
Regards David Wood, QinetiQ Farnborough
The Information contained in this E-Mail and any subsequent correspondence is private and is intended solely for the intended recipient(s). For those other than the recipient any disclosure, copying, distribution, or any action taken or omitted to be taken in reliance on such information is prohibited and may be unlawful.
Wood David wrote:
Thanks for your reply. I've managed to cut down the module to this very short module so I just get two errors, both - prior parameter's size depends on 'A':
Thanks for the example code.
Is the module syntax illegal or is it a bug?
No, the syntax is correct AFAICS. (If not, it would *also* be a bug, because GPC should have reported a syntax error then. ;-)
I suppose the different behaviour is rooted in the fact that modules have interface and implementation parts that are compiled separately (because they can even be in different files), while units are one piece. Therefore, while compiling module implementations, GPC loads the GPI files created during compilation of the interface, and some important piece of information (that is needed during the definition of a procedure, not for its use by importers) is apparently not stored in the GPI file (whereas for units, the original "forward" declaration from the interface is just retained during compilation of the implementation).
So I think I know now what to look for (and where).
If it is a bug, at least you can take comfort in knowing it can kill the DEC Pascal compiler too!
Yeah, but actually I prefer to emulate the features, not the bugs, of all other Pascal compilers. ;-)
Frank
Some time ago, Wood David wrote:
Thanks for your reply. I've managed to cut down the module to this very short module so I just get two errors, both - prior parameter's size depends on 'A':
[...]
It's fixed in the latest alpha.
S. Achterop IWI-120 3932 wrote:
The code below yields the following error on (e.g.) gpc version 20020910, based on gcc-2.95.4 20011002 (Debian prerelease)
v.p: In procedure `Getfilename': v.p:8: prior parameter's size depends on `Fext' v.p:8: prior parameter's size depends on `Fext'
[...]
Same here.
Frank