On 5/13/20, Rich Morin <rdm(a)cfcl.com> wrote:
A Fortran implementation I used years ago kept constants in a "literal
pool". So, if you called a subroutine, passing in a constant, there was a
possibility that the constant might be modified upon the routine's return.
I don't recall this ever causing a problem in practice, but the possibility
was amusing...
Any modern compiler worth its salt does literal pooling. Fortunately
modern operating systems have the concept of read-only address space.
These days attempts to modify literal pool constants will give you a
memory access violation at the point where the illegal modification
was made.
-Paul W.