New Project Options for the Compiler

In the "Delphi Compiler/Compiling" page, which used to be called compiler, the Code Generation section has the following new options:

  • Code inlining control corresponds to the $INLINE compiler directive and controls how inlining works.
  • Emit runtime type information corresponds to -$M flag on the command line or the $M directive, and determines the generation of runtime time information for a given class (or all of the classes of a project).
  • Minimum enum size corresponds to -$Z flag (or the $Z directive) and determines the minimum size used for values of enumerated types (a Byte, a Word, a Double Word, or a Quad Word).
  • String format checking, which is on by default, can be disabled to avoid some automatic string format checks66 and corresponds to the $STRINGCHECKS directive. This compiler option is new to Delphi 2009 and was supposed to remain undocumented and fairly hidden... so it is quite a surprise to see it prominently in Project Options dialog box.
  • Code page was already in past versions but is now much more relevant in relationship with how the AnsiString type works, again as covered in Chapter 2.

The Debugging section has the new option Use imported data references (mapped to $G), which controls the creation of imported data references (increasing memory efficiency but preventing the access of global variables defined in other runtime packages).

The Runtime errors and Syntax options sections have the same elements (and also the same defaults) as past versions of Delphi. The Other options section sports new options, except the Generate XML documentation that was already available:

• Additional switches to pass to the compiler can be used to insert directly further command line compiler options not specifically supported by the IDE, although having this feature available now technically means that Delphi 2009 now supports each and every compiler option.

66 As we saw in Chapter 2, in many places within the Delphi RTL, there are calls to the EnsureUnicodeString function and other functions of the Ensure String family. You can ask the compiler to skip these extra calls by disabling using the --string-checks compiler options or the SSTRINGCHECKS directive. These switches are not documented and not officially supported, but directly available in the Project Options dialog of the IDE, which I find quite odd.

  • Allow unsafe code will let you compile code deemed unsafe for a managed environment like .NET and makes little (or no) sense with the Win32 compiler.
  • Look for 8.3 filenames also instructs the compiler to work on very old versions of Windows and corresponds to the -P compiler option.
  • Output unit dependency information will turn on the --depends compiler flag, which is apparently not maintained for now.

Was this article helpful?

0 0
Project Management Made Easy

Project Management Made Easy

What you need to know about… Project Management Made Easy! Project management consists of more than just a large building project and can encompass small projects as well. No matter what the size of your project, you need to have some sort of project management. How you manage your project has everything to do with its outcome.

Get My Free Ebook

Post a comment