[net.bizarre] Modifying constants and recursion in FORTRAN

mouse@mcgill-vision.UUCP (der Mouse) (09/04/85)

> Modern techniques of flow analysis could theoretically catch this sort of
> trap in FORTRAN - *if* FOO were in the same source module as all calls
> to it.

     You could catch such things even when FOO and its caller are not in
the same source module, *provided* you put it in the linker rather  than
the compiler (and  have the compiler keep enough information around that
the linker can do something useful).

> ......  Another solution (depending on machine architecture, memory
> management, and OS design) would be to place all constants in a read-only
> data area.  Attempts to change constant values would either be ignored or 
> generate a run-time error.  (Anyone know of compilers/systems that do either?)

     I do.  VAX/VMS FORTRAN will accept the source  code, even when it's
all in one file, and will produce an access violation at run-time.

     (No, I don't use VMS....not since we got UNIX).
-- 
					der Mouse

{ihnp4,decvax,akgua,etc}!utcsri!mcgill-vision!mouse
philabs!micomvax!musocs!mcgill-vision!mouse

Hacker: One responsible for destroying /
Wizard: One responsible for recovering it afterward