[fpc-pascal]Exit status of compiler on errors
Michael Van Canneyt
michael.vancanneyt at wisa.be
Fri Dec 6 11:04:04 CET 2002
On Fri, 6 Dec 2002, Tom Verhoeff wrote:
> We use FreePascal in our education, and I am working on some scripts
> that help teachers to develop programming assignments for students.
> These assignments are then entered in PEACH (Programming Education
> And Contest Hosting system: peach.win.tue.nl), which automatically
> evaluates submitted programs and archives all results.
>
> It turns out that the FreePascal compiler also generates a 0 exit
> status when there are (syntax) errors. Is there any way in which
> this can be changed? My scripts would be considerably simpler if
> the compiler generated a non-zero exit status when the compile is
> not successful.
>
> Any suggestions? Have I overlooked the obvious? The Linux man page
> for fpc does not mention an exit status.
Do you use the fpc executable or the ppc386 executable ?
The ppc386 executable should always generate a nonzero exit code if an
error occurs. Our own automated testing system relies on this as well.
For the fpc executable this may be different, though. If you use this
one, I suggest you use ppc386 instead; fpc offers no additional
functionality yet except choosing the right cross-compiler if needed.
Michael.
More information about the fpc-pascal
mailing list