smart compilers

Mark Crispin MRC at SU-SCORE.ARPA
Sun Jan 6 06:26:24 AEST 1985


     I may be mistaken, but I believe according to the standards it is
not only "poor style" to change a constant which was passed to a subroutine,
it is also undefined what the behavior of the system after that should be.

     In any case, the object code from the TOPS-20 Fortran compiler is not
the only one where the value of a constant is changed as a result of such
practice.  This particular sort of bug is fairly well-known.

     There are various flavors of Fortran compilers on 10/20 and IBM systems
which will check for trying to do this sort of thing at runtime (also check
for out-of-bounds array references, remember the neat tricks we did with
those??), but that code introduces a *lot* of overhead.  You really have no
hope for catching this at compile-time; the earliest you can do it is when
linking the modules together.
-------



More information about the Comp.unix.wizards mailing list