Subsections
D. Compiler modes
Here we list the exact effect of the different compiler modes. They can be
set with the $Mode switch, or by command line switches.
This mode is selected by the $MODE FPC switch. On the command-line,
this means that you use none of the other compatibility mode switches.
It is the default mode of the compiler. This means essentially:
- You must use the address operator to assign procedural variables.
- A forward declaration must be repeated exactly the same by the
implementation of a function/procedure. In particular, you can not omit the
parameters when implementing the function or procedure.
- Overloading of functions is allowed.
- Nested comments are allowed.
- The Objpas unit is NOT loaded.
- You can use the cvar type.
- PChars are converted to strings automatically.
This mode is selected by the $MODE TP switch. On the command-line,
this mode is selected by the -So switch.
- You cannot use the address operator to assign procedural variables.
- A forward declaration must not be repeated exactly the same by the
implementation of a function/procedure. In particular, you can omit the
parameters when implementing the function or procedure.
- Overloading of functions is not allowed.
- The Objpas unit is NOT loaded.
- Nested comments are not allowed.
- You can not use the cvar type.
This mode is selected by the $MODE DELPHI switch. On the command-line,
this mode is selected by the -Sd switch.
- You can not use the address operator to assign procedural variables.
- A forward declaration must not be repeated exactly the same by the
implementation of a function/procedure. In particular, you not omit the
parameters when implementing the function or procedure.
- Overloading of functions is not allowed.
- Nested comments are not allowed.
- The Objpas unit is loaded right after the system unit. One of the
consequences of this is that the type Integer is redefined as
Longint.
This mode is selected by the $MODE GPC switch. On the command-line,
this mode is selected by the -Sp switch.
- You must use the address operator to assign procedural variables.
- A forward declaration must not be repeated exactly the same by the
implementation of a function/procedure. In particular, you can omit the
parameters when implementing the function or procedure.
- Overloading of functions is not allowed.
- The Objpas unit is NOT loaded.
- Nested comments are not allowed.
- You can not use the cvar type.
This mode is selected by the $MODE OBJFPC switch. On the command-line,
this mode is selected by the -S2 switch.
- You must use the address operator to assign procedural variables.
- A forward declaration must be repeated exactly the same by the
implementation of a function/procedure. In particular, you can not omit the
parameters when implementing the function or procedure.
- Overloading of functions is allowed.
- Nested comments are allowed.
- The Objpas unit is loaded right after the system unit. One of the
consequences of this is that the type Integer is redefined as
Longint.
- You can use the cvar type.
- PChars are converted to strings automatically.
root
2000-12-20