[fpc-pascal] Precedence of compiler switches/directives

Peter peter at pblackman.plus.com
Thu Oct 8 10:54:15 CEST 2020


I'm curious about who wins, if switches/directives are set to different values in different places.
They could be set in
fpg.cfg
Command line or Lazarus lpi
Directives in the code.

Is there some AND/OR logic, or is it a strict precedence order? Is it the same for all switches?
I can see for example that some switches can be turned on but not off at the command line.

I gather command line options take precedence over fpc.cfg, but what about directives in the code?  If a directive says
range checks off, but the command line and/or fpc.cfg says range check on, what happens?

I assume that as directives can be set to different values in different parts of the code, that they must have the
highest precedence. Is this correct and always the case?


Peter



More information about the fpc-pascal mailing list