For more information on these options, see Programmer’s Guide
- Set language mode to mode, which can be one of the following:
- Try to be Delphi compatible. This is more strict than the objfpc mode, since
some Free Pascal extensions are switched off.
- Free Pascal dialect (default).
- Try to be compatible with Macintosh Pascal dialects.
- Switch on some Delphi extensions. This is different from Delphi mode, because
some Free Pascal constructs are still available.
- Try to be TP/BP 7.0 compatible. This means no function overloading etc.
- Select language feature feature. As of FPC version 2.3.1, the -M command line
switch can be used to select individual language features. In that case, feature is one of the
- Use object pascal classes.
- Automatically include the ObjPas unit.
- Enable the Result identifier for function results.
- Allow automatic conversion of null-terminated strings to
- Allow the use of the CVAR keyword.
- Allow use of nested comments.
- Use classical procedural variables.
- Use mac-style procedural variables.
- Implementation and Forward declaration must match
- Allow silent conversion of pointers to procedural
- Automatic (silent) dereferencing of typed pointers.
- Allow use of Initialization and Finalization
- Allow use of pointer arithmetic.
- Allow use of ansistrings.
- Allow use of the out parameter type.
- Allow use of default parameter values.
- Support the hint directives (deprecated, platform etc.)
- Allow use of global properties.
- Allow inline procedures.
- Allow the use of exceptions.
The keyword can be followed by a plus or minus sign to enable or disable the
- Specify what kind of assembler you use in your asm assembler code blocks. Here xxx is one
of the following:
- asm blocks contain AT&T-style assembler. This is the default style.
- asm blocks contain Intel-style assembler.
- Use the default assembler for the specified target.
- asm blocks should be copied as is in the assembler, only replacing certain
- Switch on Delphi 2 extensions (objfpc mode). Deprecated, use -Mobjfpc instead.
- Include assert statements in compiled code. Omitting this option will cause assert statements
to be ignored.
- Support C-style operators, i.e. *=, +=, /= and -=.
- Try to be Delphi compatible. Deprecated, use -Mdelphi instead.
- The compiler stops after the N-th error. Normally, the compiler tries to continue compiling
after an error, until 50 errors are reached, or a fatal error is reached, and then it stops. With
this switch, the compiler will stop after the N-th error (if N is omitted, a default of 1 is
assumed). Instead of a number, one of n, h or w can also be specified. In that case the
compiler will consider notes, hints or warnings as errors and stop when one is
- Support the label and goto commands. By default these are not supported. You must also
specify this option if you use labels in assembler statements. (if you use the AT&T style
- Use ansistrings by default for strings. If this option is specified, the compiler will interpret the
string keyword as an ansistring. Otherwise it is supposed to be a shortstring (TP
- Support C++ style INLINE.
- Set interfaces style to XXX.
- Load the Kylix compatibility unit (fpcylix).
- Support C-style macros.
- Try to be Borland TP 7.0 compatible. Deprecated, use -Mtp instead.
- The name of constructors must be init, and the name of destructors should be
- Allow the static keyword in objects.
- Enable exception keywords (default in Delphi/Objfpc mode). This will mark all exception
related keywords as keywords, also in Turbo Pascal or FPC mode. This can be used to check
for code which should be mode-neutral as much as possible.
- Do not check the unit name. Normally, the unit name is the same as the filename. This
option allows them to be different.
- Compile a system unit. This option causes the compiler to define only some very basic