$O: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: $O
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Back to [[global compiler directives]]. | |
| 2 | + | ||
| 3 | + | Since Free Pascal v2.0.0, the [[global compiler directives|global compiler directive]] **\$O** has the same meaning as the [[local compiler directives|local compiler directive]] **\$OPTIMIZATION** switching on/off level two optimizations. | |
| 4 | + | ||
| 5 | + | **\$O** uses the + and - switches. | |
| 6 | + | ||
| 7 | + | **\$OPTIMIZATION** uses the ON and OFF switches. | |
| 8 | + | ||
| 9 | + | Example: | |
| 10 | + | ||
| 11 | + | ``` pascal | |
| 12 | + | // Enable global level 2 optimization | |
| 13 | + | {$O+} | |
| 14 | + | ||
| 15 | + | // Enable local level 2 optimization | |
| 16 | + | {$OPTIMIZATION ON} | |
| 17 | + | ``` | |
| 18 | + | ||
| 19 | + | --- | |
| 20 | + | *From the Free Pascal wiki, page "$O", as it stood on 2020-03-06 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
