Microsoft open sources GWBASIC

Eric Korpela korpela at ssl.berkeley.edu
Sun May 31 17:13:23 CDT 2020


Most languages will give you some way to shoot yourself in the foot.  The
question is how much work do you need to do?  In FORTRAN the easiest method
was changing the value of a literal in a subroutine call.  It is standard
compliant behavior that goes back to at least FORTRAN IV.   Current
compliers and converters go to pains to make sure it still happens.  Not
sure if it is still present in f90 and beyond.  At least modern compilers
for other languages will give you a "potential foot shooting warning",
although in C++ that warning statement could take 200 kB.

C
C     CHANGE THE VALUE OF 4
C

      CALL INC(4)
      WRITE (*, 30) 4
30    FORMAT ('2+2=',I4)
      END

      SUBROUTINE INC(I)
      I = I + 1
      END

-------- OUTPUT
2+2=   5


More information about the cctech mailing list