Command-line option to turn off the writeable constants
Original Reporter info from Mantis: Michalis @michaliskambi
-
Reporter name: Michalis Kamburelis
Original Reporter info from Mantis: Michalis @michaliskambi
- Reporter name: Michalis Kamburelis
Description:
It seems you can turn on/off the "writeable constants" only using the compiler directives in code, see http://www.freepascal.org/docs-html/prog/progsu42.html .
A command-line option to turn off the writeableconsts (having the same effect as using "{$J-}" at the beginning of every compiled source code) would be useful. It would allow any tool to control writeableconsts from the command-line. For example, Lazarus could then add an option "Writeable constants" in the project compilation options, Castle Game Engine build tool could turn it off by default, and users could disable it in their fpc.cfg (though it would be risky if you compile someone else's code, but that's always a risk with adding syntax options to fpc.cfg).
As for the exact name and syntax of the command-line option, I would suggest -Sj , for consistency with -Sh . To turn off the writeable constants, one could then use "-Sj-". This would be consistent with "-Sh" and "-Sh-" and "{$H+/-}" in the code, as far as I see.
Mantis conversion info:
- Mantis ID: 30344
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 37437 (#fcc1ce7a)
- Monitored by: » Vincent (Vincent Snijders)