[net.lang.pascal] No error message for missing "end" statement.

pmontgom@sdcrdcf.UUCP (Peter Montgomery) (08/06/83)

{ When compiled using "pc -c", this yields no syntax errors. }
{ But when we try to link it with other procedures, "two" is undefined. }
{ Using "pc -S" or "nm" shows nothing written to the object file for "two". }

{ We use Berkeley Pascal PC -- Version 2.0 (Fri Jul 10 17:13:18 1981). }

procedure two; forward;
procedure one;
begin
    two;
end { one };

procedure two;
begin
    while 1 <= 0 do begin writeln(1); { begin without end };
end { two };
(*
				   Peter Montgomery

	{bli,blix,bmcg,burdvax,cbosgd,csun,ihnss,hplabs,ihnp4,netvax,orstcs,
	parallax,randvax,sdccsu3,slant45,sdcnet,sytek,trw-unix,ucla-s,
	ucla-vax,hughes}!sdcrdcf!pmontgom
*)

zz1sm@sdccsu3.UUCP (Shane) (08/10/83)

At UCSD, we use Berkeley Pascal in some of our upper-division EECS
courses. This bug quickly bared its teeth when students in a compiler
writing course started using seperate compilation of BPascal routines.
Of course, since the compiler doesn't generate a diagnostic, it is
frustrating to find, at the end of a big make, that you have to go
back and remake the whole thing. (Worse, the bug was usually not identified 
correctly by many students). Anyway, best way to get a diagnostic seems to
be to just insert an extraneous 'end' at the end of the file containing
the routine which the linker says is undefined at ld time. Then you 
will get a diagnostic that should properly inform you of the missing
end (which is now an improperly placed end).

Shane
ucbvax!sdcsvax!sdccsu3!zz1sm

stuart@rochester.UUCP (Stuart Friedberg) (08/14/83)

I noted this problem several months ago, and between us we aren't the
only ones to notice the problem. I have no idea why the compiler doesn't
complain about the missing end. I did find out that some code is generated
but the (crucial) external symbols needed to link the routines with others
are not put into the .o file.  Can somebody at Berkeley explain the problem?