unit/procedure same name, unhelpful error

Waldek Hebisch hebisch at math.uni.wroc.pl
Wed Jul 18 18:16:33 CEST 2012

Jay Michael wrote:
> some of the source when it issues a compilation error?  Like
>           jsm2.pas:5:jsm2m;
>           jsm2.pas:5:^---error: expression used as a statement

Currently no such option.
> In the test case it's not much more informative than the line number.
> In the original code, where the procedure had 5 or 8 arguments, it
> would have focused me on the procedure that turned out to also be
> a module name.  (I spent a lot of time getting the error message=20
> backwards and trying to see if one of the arguments was being affected
> by a preprocessor directive that changed it into a procedure call or
> other statement where I needed an expression.)
>      Does the compiler have enough information to reconstruct the=20
> source representation of the expression it thinks is being used as
> a statement?  I know there's no limit to how big that could be.
> Again, I think it would help to know exactly which source is
> upsetting the compiler.

Compiler keeps line numbers of expressions in the input.  ATM
compiler does not know position of offending item within the
input line.  Also, the expressions are transformed and
what compiler have in hand may be quite different from
user input.  In principle printing compiler data in
Pascal-like form could be of some use, but compiler have
no routine for doing this.

                              Waldek Hebisch
hebisch at math.uni.wroc.pl 

More information about the Gpc mailing list