Hi
While recompiling the programs in the demos directory of gpc I found a bug (may be only in the demo program)
factorial.pas: In main program: factorial.pas:45: reference expected, value given factorial.pas:45: invalid type of argument of `ReadStr/Val'
the offending line is
ReadStr (ParamStr (1), n);
It was valid last time I compiled these demo programs.
If I affect ParamStr(1) to a temporary String (or CString with {$X+}) everything is correct.
The problem seems related to the fact that in the doc ReadStr is defined as
procedure ReadStr (const S: String; variables);
There is somewhere written (for parameters passing to C) that const parameters can be either value or reference, depending on compiler convenience.
And also to the discussion on undiscriminated String parameter passing.
So either change the compiler or the demo programs (there are several occurences of the bug in the demos). But it would be better that such a natural construct work as expected.
Hope this helps
Maurice