1

In the project dof and cfg files, they are some undocumented switches: E, F, K, N and S. They appear also when inserting switches with ctrl-O-O:

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}

These switches are not described in the help files. delphi7 compilation switches

Could someone have any information about their meaning?

Gilles Arcas
  • 2,692
  • 2
  • 18
  • 13

3 Answers3

3

Note: {$N} and {$E} are handled as a pair.

{$F-} = force far calls (Turbo Pascal/Borland Pascal and Delphi 1 (16-bit) only; does nothing in newer Delphis)

{$K-} Smart callbacks

{$S-} = Stack checking. if {$S+} , a call to a Stack check routine is inserted in the start of every procedure/function to check if space for the local variables can be reserved on the stack. Causes EStackOverflow (if SysUtils is USEd) or terminates with a runtime error (if SysUtils is NOT USEd) if there isn't enough space in the stack for the local variables.

{$N+} and {$E-}: These were used in Turbo Pascal. (and possibly Delphi 1 ?) In newer Delphis they are not used, but see the Real48 type and {$REALCOMPATIBILITY} directive.

{$N-, E+} meaningless, either treated as {$N-, E-} or causes a compilation error.

{$N-, E-} the Real type is a 6 -byte (= 48 -bit) software real. Math coprocessor is not used (even if it exists).

{$N+, E+} the Real type is a 8 -byte Math coprocessor real (IEEE real), the same type as Double in Delphi. The math coprocessor is used (if it exists), otherwise it is emulated via software (slow, but produces same results as the math coprocessor would).

{$N+, E-} the Real type is a 8 -byte Math coprocessor real (IEEE real), the same type as Double in Delphi. The math coprocessor must be present at runtime, otherwise the program immediately exits with a runtime error "Math coprocessor required, but not present".

Recent windows versions are not able to run with a CPU so old, that it does not have built-in floating-point unit, so {$N+} and {$E-} are now meaningless.

AHiismak
  • 119
  • 6
2

The easy way to out these "undocumented" is to run DCC32.exe from the command line, you will see all the compiler options available to your version of Delphi. Over the years, some switches have changed.

Turbo Pascal/Borland Pascal:
Compiler switches: -$<letter><state>  (defaults are shown below)
  A+ Word alignment       I+ I/O error checking   R- Range checking
  B- Full boolean eval    L+ Local debug symbols  **S+ Stack checking**
  D+ Debug information    **N- 80x87 instructions**   T- Typed pointers
  **E+ 80x87 emulation**      O- Overlays allowed     V+ Strict var-strings
  **F- Force FAR calls**      P- Open string params   X+ Extended syntax
  G- 80286 instructions   Q- Overflow checking
Memory sizes: -$M<stack>,<heapmin>,<heapmax>  (default: 16384,0,655360)

I still compile in Pascal, so I recognized these... $K is not from the Turbo Pascal days, nor Free Pascal nor Delphi 7 or older. (I do not use newer than D7 - so maybe a CodeGear or Embarcadero version?

Ozz Nixon
  • 159
  • 1
  • 8
  • The one I didn't know is from D2: {$K-} { Smart callbacks } – Ozz Nixon Jan 15 '18 at 21:37
  • Interesting. None of these options appears in the IDE option window (nor in D7 DCC32 output). It seems that at one moment the Delphi team chose to freeze them with the values given in the config file. Accepted. – Gilles Arcas Jan 27 '18 at 15:59
-1

Most of the directives you list are documented in Embarcadero's DocWiki:

Delphi Compiler Directives

{$A8} = Align record fields to QuadWord alignment

{$B-} = enable Boolean short-circuit evaluation

{$C+} = enable asserts

{$D+} = enable debug Information

{$E-} = ?

{$F-} = ?

{$G+} = enable imported data references

{$H+} = enable long strings (set String type to AnsiString) - ignored in modern Delphi versions

{$I+} = enable I/O procedure checks

{$J-} = disable writable constants

{$K-} = ?

{$L+} = enable local symbol information

{$M-} = disable runtime type information

{$N+} = ?

{$O+} = enable code optimizations

{$P+} = enable open string parameters - ignored in modern Delphi versions

{$Q-} = disable overflow checks

{$R-} = disable range checks

{$S-} = ?

{$T-} = disable type-checked pointers

{$U-} = disables Pentium-safe floating-point division operations 

{$V+} = enable strict checking of short string parameters

{$W-} = generate stack frames only when required

{$X+} = enable extended language syntax

{$Y+} = generate symbol cross-reference information

{$Z1} = set minimum enumeration size to 1 byte

As you can see, the 5 particular switches you are asking about are STILL not documented after 15 years since Delphi 7 was released. So it is unknown what they actually do, if anything.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 2
    This answers everything other than what was actually asked. It's clear that the user knows what the documented options do. Questions pertains entirely to the 5 that you have explained as '?'. – David Heffernan Jan 07 '18 at 10:24
  • @DavidHeffernan I'm aware of that, which is why I pointed out that after 15 years, those 5 switches were never documented, so it is unknown what they do, if anything – Remy Lebeau Jan 07 '18 at 19:33