[fpc-pascal]Re: Exit status of compiler on errors

Tom Verhoeff wstomv at win.tue.nl
Fri Dec 6 11:12:30 CET 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.

I just discovered that invoking the compiler as  ppc386  does give
a proper exit status, but when invoking it as  fpc  it does not.
(Still under Linux.)

Why is that?

By the way, this is also relevant when calling the compiler from
within make files.

The gcc man page clearly explains the policy for its exit status.
Maybe an idea for fpc (doc/manpage) as well.


More information about the fpc-pascal mailing list