[fpc-devel] about {$OPTIMIZATION xxx} // Re: error in docs ?

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Thu Feb 6 19:11:44 CET 2014


Martin Frb wrote:
> On 06/02/2014 17:48, Martin Frb wrote:
>> http://www.freepascal.org/docs-html/prog/progsu58.html#x64-630001.1.58
>>
>>> Example:
>>>
>>> {$OPTIMIZATION ON}
>>>
>>> is equivalent to
>>>
>>> {$OPTIMIZATION 2}
>>
>> "2" is not in the list of supported keywords.
>>
>> And at least {$OPTIMIZATION 1} gives an compile error
>>
> 
> {$OPTIMIZATION 2}  gives an error
> but
> 
> {$OPTIMIZATION -usemachspeed}
> Note the "-", fpc accepts everithing, if there is a dash, why.
> 
> Also, it appears one can only enable options, Or go down to a lower 
> level? But not selectively switch an opt off?

Related question: can {$ifopt return any information about optimisation 
level? (Rationale: the other day I was trying to code some extremely 
rough fudge factors so that a program could throttle its performance 
depending on CPU type etc.).

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-devel mailing list