Compiler options to have a default value and command to revert to it
Original Reporter info from Mantis: zex2011
-
Reporter name: Zex Atilla
Original Reporter info from Mantis: zex2011
- Reporter name: Zex Atilla
Description:
During testing I usually set RangeChecks On, except for some parts of the code. This is how I do it:
...normal code...
{$R-}
...code without range checking...
{$R+}
...normal code...
The problem is, after the second option {$R+} range checking is always on, even when I'm producing the final version of the program. Regardless of the global project options, after that line RangeChecks will be ON and my program will run slower. Same problem applies to other compiler options.
So my suggestion is to add two more compiler option qualifiers:
{$R+ def} // make this default value for RangeChecks
{$R#} // revert to the default value
Then in the code I can do this:
...normal code...
{$R-}
...code without range checking...
{$R#}
...normal code...
Mantis conversion info:
- Mantis ID: 20680