Compiler modes and strictness
PXX has one dialect, not several semantic modes. What changes is how strict that dialect is about a handful of FPC-parity rules. This page explains the model as a whole; the individual switches are listed on the command line page and, for the in-source forms, on the directives page.
The model: lax → strict → mimic
-
Lax by default. PXX's own dialect is deliberately permissive. Declaration order, member visibility, operator and overload resolution, and
case-label checking are all relaxed unless you ask for the stricter behavior. This keeps quick programs and in-progress code compiling without ceremony. -
--strict— the umbrella. Turns on the FPC-parity strictness family together. Today that family is the routine-visibility check (--require-forward); the umbrella name is the stable entry point as more checks join it. -
Granular switches — one rule at a time. Each check is independently toggleable, so you can tighten (or loosen) exactly one rule without the whole umbrella:
Switch What it enforces Lax default --require-forwardRoutine defined/declared before its call site. Whole-source pre-scan finds it anywhere. --strict-overloadExplicit overload;on overloaded routines.Marker not required. --strict-operatorReject =/<>on class operands.Value-equality operators allowed. --strict-caseInverted-range and duplicate/overlapping caselabels are errors.First-match, no diagnostics. --strict-visibilityprivate/protected/strictaccess is enforced.Markers parsed, access granted anywhere. --lax-decl-order(opt-out) declare-before-use for forward-visible globals. Enforced by default. Each also has an in-source directive form (
{$STRICT_OVERLOAD ON},{$STRICT_CASE ON},{$DECLORDER OFF}, …) so a source file can carry its own strictness need — see directives. -
--strict-fpc— the FPC-parity umbrella. Turns on the strict checks that match FPC's behaviour and are proven to compile the real FPC corpora at once:--strict-case,--strict-operator,--strict-visibility, and--require-forward. In-source form:{$STRICT_FPC ON}.--strict-overloadis not part of the umbrella. PXX's own libraries overload freely without theoverload;marker — that is the intended lax dialect — so requiring the marker would reject the very libraries FPC-oriented code links against. It remains available as a standalone switch for marker-clean code. -
--mimic-fpc— the compatibility preset. For compiling FPC-oriented code. It is--strict-fpcplus what makes PXX present as FPC: the curated FPC define set (so identity-probing headers pick their FPC path) and IO checking ({$I+}). A preset built on top of the strict family, not a separate mode. The in-source equivalent is{$MIMIC FPC}. For the FPC-specific details of what ports and what does not, see FPC compatibility.
Why lax is the default
PXX is its own dialect first and an FPC-compatibility tool second. The lax
default serves the dialect; the strict flags and --mimic-fpc serve
compatibility when you want it. That split is deliberate: you opt into
FPC-parity strictness per rule, rather than opting out of it.
Note that {$mode objfpc} / -Mobjfpc and the other FPC mode markers are
accepted as compatibility markers only — they do not switch PXX into a
different semantic mode. Strictness is controlled by the switches above, not by
the mode marker.