Recent

Author Topic: Optimization switch  (Read 265 times)

dseligo

  • Hero Member
  • *****
  • Posts: 813
Optimization switch
« on: October 02, 2022, 03:00:46 pm »
Is compiler switch
Code: Pascal  [Select][+][-]
  1. {$O-}
same as
Code: Pascal  [Select][+][-]
  1. {$OPTIMIZATION OFF}
?

Documentation here doesn't mention it: https://www.freepascal.org/docs-html/prog/progsu58.html#x65-640001.2.58

If it is, can it take all the values described in documentation?

Thaddy

  • Hero Member
  • *****
  • Posts: 12208
Re: Optimization switch
« Reply #1 on: October 02, 2022, 03:15:43 pm »
Yes. Even a couple more. Most should only be of interest to highly capable programmers, though: you need some knowledge how optimization theory works...
« Last Edit: October 02, 2022, 03:18:18 pm by Thaddy »
Manuals, manuals, manuals first.
You have incompetence and sheer incompetence.

ASerge

  • Hero Member
  • *****
  • Posts: 2034
Re: Optimization switch
« Reply #2 on: October 02, 2022, 07:18:48 pm »
If it is, can it take all the values described in documentation?
From Introduction:
For long switches, the + or - character to switch the option on or off, may be replaced by the ON or OFF keywords.
Thus {$I+} is equivalent to {$IOCHECKS ON} or {$IOCHECKS +} and {$C-} is equivalent to {$ASSERTIONS OFF} or {$ASSERTIONS -}

 

TinyPortal © 2005-2018