Peter Gerwinski wrote:
1.
The output of a compiler program is not redirectable (neither as stdout, nor stderr).
Hmmm ... I am redirecting stderr all the time ... what OS are you using? With DJGPP and the BPcompat package, redirection is turned off when DirectVideo is `true'.
Yes, I'm using DJGPP - sorry I forgot to mention. It seems redirection is turned off by default even without the BPcompat package. This was confusing me. I don't use Crt in my program, so I didn't think of DirectVideo. Now when I copy the declaration of DirectVideo from Crt (I don't want to use the whole unit in this program), it works.
I guess redirection is turned off by default because the usual output via Dos is quite slow!?
(And redirection is not easy with DJGPP anyway.)
Why? The only problem I know of is that Command.Com can't redirect stdout. But that's merely a problem of Dos' shell, and is solved by the REDIR utility. Otherwise it works fine for me. Or are there any other problems?
3.
Okay. I am adding it to my bug list. Thanks. :-)
Workaround: GPC has no problems to deal with structures above 65520 bytes. [...]
Yes, I know. Actually I'm using now:
CONST MaxVar=$FFF0;
TYPE XArray=ARRAY[1..MaxVar {$IFDEF TP} DIV SizeOf(X) {$ENDIF}] OF X;
I'm just hoping to reduce the number of IFDEFs required to get the program working on both TP and gpc.
6.
Is there anything like TP's Exit (return from current procedure/function)? I couldn't find it in the docs.
Return.
Thanks! I really could have guessed that myself...
4. Berend de Boer wrote:
PROCEDURE p(CONST c:t)
This is BP, try the EP standard
PROCEDURE p(protected c:t)
as a workaround.
Yes, that works. Thanks!
With the help of the preprocessor (luckily it's case-sensitve!), I can even write the following code that compiles with TP and gpc:
{$DEFINE Const PROTECTED}
CONST a=1;
PROCEDURE p(Const c:t);
7. ...but this led me to another problem. It seems more involved (perhaps something about GPI files?). I couldn't simplify the example more than the following, especially there has to be a unit, r must be a record (at least with r=Integer the bug doesn't show), and p has to be protected:
UNIT u;
INTERFACE TYPE r=RECORD a:Integer END;
PROCEDURE f(PROTECTED p:r);
IMPLEMENTATION PROCEDURE f(PROTECTED p:r); BEGIN END; END.
PROGRAM x; USES u; VAR p:r; BEGIN f(p) {} END.
gpc complains about line {}: incompatible type for argument 1 of `F'
Frank