The menu ”Options—Compiler” allow the setting of options that affect the compilers behavior. When this menu item is chosen, a dialog pops up that displays several tabs.
There are six tabs:
Here options can be set that affect the various syntax aspects of the code. They correspond mostly to the -S option on the command line (section 5.1.5, page 124).
These options control the generated code; they are mostly concerned with the -C and -X command line options.
These set the verbosity of the compiler when compiling. The messages of the compiler are shown in the compiler messages window (can be called with F12).
Options concerning the generated browser information. Browser information needs to be generated for the symbol browser to work.
Options concerning the reading of assembler blocks (-R on the command line) and the generated assembler (-A on the command line)
Here the target processor can be selected.
On each tab page, there are two entry boxes: the first for Conditional defines and the second for additional compiler arguments. The symbols, and arguments, should be separated with semi-colons.
The syntax tab of the compiler options dialog is shown in figure (6.23).
In the syntax options dialog, the following options can be set:
when checked, the compiler stops after the first error. Normally the compiler continues compiling till a fatal error is reached. (-Se (see page 127) on the command line)
Allow the use of label declarations and goto statements (-Sg (see page 129) on the command line).
Allow the use of macros (-Sm (see page 129)).
Allow the use of inlined functions (-Sc (see page 127) on the command line).
Include Assert statements in the code.
Load the Kylix compatibility unit.
Allow the Static modifier for object methods (-St (see page 129) on the command line)
Allows the use of some extended operators such as +=, -= etc. (-Sc (see page 127) on the command line).
select the appropriate compiler mode:
The default Free Pascal compiler mode (FPC).
Enables the use of classes and exceptions (-Sd (see page 127) on the command line).
Try to be more Turbo Pascal compatible (-So (see page 129) on the command line).
Try to be more Delphi compatible (-Sd (see page 127) on the command line).
Try to be Macintosh pascal compatible.
The code generation tab of the compiler options dialog is shown in figure (6.24).
In the code generation dialog, the following options can be set:
Controls what run-time checking code is generated. If such a check fails, a run-time error is generated. The following checking code can be generated:
Checks the results of enumeration and subset type operations (-Cr (see page 114) command line option).
Checks whether the stack limit is not reached (-Cs (see page 114) command line option).
Checks the result of IO operations (-Ci (see page 114) command line option).
Checks the result of integer operations (-Co (see page 114) command line option).
Check the validity of the method pointer prior to calling it.
Generate PIC code.
Create smartlinkable units.
What optimizations should be used when compiling:
Corresponds to the -OG command line option.
Corresponds to the -Og command line option.
More information on these switches can be found in section 5.1.4, page 111.
The processor tab of the compiler options dialog is shown in figure (6.25).
In the processor dialog, the target processor can be set. The compiler can use different optimizations for different processors.
The verbose tab of the compiler options dialog is shown in figure (6.26).
In this dialog, the following verbosity options can be set (on the command line: -v (see page 105)):
Generate warnings. Corresponds to -vw on the command line.
Generate notes. Corresponds to -vn on the command line.
Generate hints. Corresponds to -vh on the command line.
Generate general information. Corresponds to -vi on the command line.
Generate information on used and tried files. Corresponds to -vut on the command line.
Switch on full verbosity. Corresponds to -va on the command line.
If an error using overloaded procedure occurs, show all procedures. Corresponds to -vb on the command line.
The browser tab of the compiler options dialog is shown in figure (6.27).
In this dialog, the browser options can be set:
(default) No browser information is generated by the compiler.
Browser information is generated for global symbols only, i.e. symbols defined not in a procedure or function (-b on the command line)
Browser information is generated for all symbols, i.e. also for symbols that are defined in procedures or functions (-bl on the command line)
Remark If no browser information is generated, the symbol browser of the IDE will not work.
The assembler tab of the compiler options dialog is shown in figure (6.28). The actual dialog may vary, as it depends on the target CPU the IDE was compiled for.
In this dialog, the assembler reader and writer options can be set:
This permits setting the style of the assembler blocks in the sources:
The assembler is written in AT&T style assembler (-Ratt on the command line).
The assembler is written in Intel style assembler blocks (-Rintel on the command line).
remark that this option is global, but locally the assembler style can be changed with compiler directives.
When writing assembler files, this option decides which extra information is written to the assembler file in comments:
The source lines are written to the assembler files together with the generated assembler (-al on the command line).
The compiler’s internal register allocation/deallocation information is written to the assembler file (-ar on the command line).
The temporary register allocation/deallocation is written to the assembler file. (-at on the command line).
The node allocation/deallocation is written to the assembler file. (-an on the command line).
use a pipe on unix systems when feeding the assembler code to an external assembler.
The latter three of these options are mainly useful for debugging the compiler itself, it should rarely be necessary to use these.
This option tells the compiler what assembler output should be generated.
This depends on the target.
Assemble using gnu as (-Aas on the command line).
Produce NASM coff assembler (go32v2, -Anasmcoff on the command line)
Produce NASM elf assembler (linux, -Anasmelf on the command line).
Produce NASM obj assembler (-Anasmobj on the command line).
Produce MASM (Microsoft assembler) assembler (-Amasm on the command line).
Produce TASM (Turbo Assembler) assembler (-Atasm on the command line).
Write binary coff files directly using the internal assembler (go32v2, -Acoff on the command line).
Write binary pecoff files files directly using the internal writer. (Win32)