gcc vs. commercial C compiler (Sun's)

Steve Summit scs at adam.pika.mit.edu
Thu Feb 2 16:29:18 AEST 1989


In article <286 at proton.UUCP> proton!nusbaum at ucrmath.ucr.edu (R. James Nusbaum) writes:
>Does anyone have any thoughts on the use of...a relatively new
>compiler as compilers go...where software failure could cause loss of life?

If you are writing life-critical software, YOU must be sure that
it is safe.  (Hal Schloss has already made this point; I am just
making it more strongly.)  You should no more assume that your
compiler is perfect than assume that your code is perfect: you
test your complete system exhaustively, and any bugs in the
compiler are found "automatically."  (This is not to say that
your test cases have to validate the entire compiler; you end up
testing only those language and compiler features that you use,
a set which by definition is embodied in your executable code,
which is what you are already testing.)

If your device fails and injures someone, and it is later shown
that the failure can be traced to a compiler error, it is still
your fault for not having caught the failure during evaluation.

In any case, there should be little or no truly life-critical
software.  Modern systems use lots of software for user-friendly
interfaces, but (in a properly designed system) user interface
software isn't life-critical.  Ideally, hardware (electronic or
mechanical) interlocks should prevent unsafe operation no matter
how confused the software gets.  Several people have voiced
extreme concern about the use of the software-controlled devices
being discussed.  For a device which does in fact depend on
"life-critical software," these fears are valid, but one should
not automatically shun any device with a microprocessor in it.

Patient safety is a difficult and complicated problem, and far
more than the software and its programmers is involved.  Anyone
who is interested in these issues should check out the RISKS
forum, which discusses this sort of thing all the time.

                                            Steve Summit
                                            scs at adam.pika.mit.edu



More information about the Comp.lang.c mailing list