Silent FishDev

Win64 & Unicode Modernization Playbook

Legacy Delphi 7 / 2007 to Delphi 13 & Win64 upgrade traps checklist.

Getting a 20-year-old Delphi 7 or 2007 codebase to compile cleanly on Delphi 13 Win64 is only half the battle. The dangerous defects are the ones that compile with zero errors and change runtime behavior silently.

High-risk checklist (verified on Delphi 13 CE)

  1. 01 · Extended precision & binary layout (Win32 10B x87 vs. Win64 8B IEEE Double)Audit every record containing Extended and never assume {$EXTENDEDCOMPATIBILITY ON} restores 80-bit arithmetic — it preserves 10-byte storage while computing with a 53-bit Double mantissa (full proof).
  2. 02 · Pointer-to-Integer casts & Tag / SendMessage ABIOn Win64, SizeOf(Pointer) = 8 while SizeOf(Integer) = 4. Replace pointer casts with NativeInt / NativeUInt and audit WinAPI message WPARAM/LPARAM and external DLL records.
  3. 03 · UnicodeString (Char = WideChar, 2 bytes) vs. legacy AnsiString byte buffersAudit every SizeOf(Char), Move, FillChar, PChar pointer arithmetic, and binary stream read/write that assumed 1 byte per character.
  4. 04 · Compiler directives that parse silently vs. directives that alter codegenVerify unit-local switches ({$ALIGN}, {$B+}/{$B-}, {$R+}, {$Q+}, {$EXCESSPRECISION}, {$REALCOMPATIBILITY}, {$EXTENDEDCOMPATIBILITY}) across Win32 vs. Win64 build profiles — 89 cards are documented individually in Delphi Behavior Contracts.
  5. 05 · Eager evaluation under {$B-} for Variant and overloaded operatorsEven with default short-circuit boolean evaluation ({$B-}), expressions with Variant (e.g. database Field.Value) or overloaded LogicalAnd/LogicalOr can evaluate both sides eagerly, triggering hidden side effects.
  6. 06 · Deterministic lifetimes: Managed Records & IInterface refcountingLocal records with class operator Initialize/Finalize run automatic cleanup without try..finally (see demo probe 19-managed-record.dpr), and mixed raw-object + interface references to a TInterfacedObject can double-free or free early during refactoring.
  7. 07 · External DFM, Database & DLL boundaries (Contract Dimension #9)Check DFM published streaming order, Loaded hooks, Owner vs. Parent, DB Null/Unassigned values, and stdcall/safecall calling conventions on Win64.

Audit existing code without manual annotations

You do not need to rewrite or annotate your legacy .pas files with Design-by-Contract assertions. Feed existing units to your AI coding agent backed by Delphi Behavior Contracts (delphi-legacy-upgrade skill + local MCP) and verify every operation against the 9 behavioral contract dimensions before committing.

Verify it yourself in Delphi 13 (Free < 1 MB Demo)

Every rule in these guides comes from 879 build observations and 650 executable runs on Delphi 13 Community Edition (Win32, Win64, and compile-only Android ARM). The free demo on GitHub includes the complete 74-chapter & 89-directive Table of Contents, 6 multi-difficulty excerpts, 4 complete directive cards, 8 compiler JSON receipts, 6 runnable .dpr probes, and working plugins, skills, and local offline MCP server.

Get Full Universal Suite · from $99Inspect Free Demo on GitHubAll Technical Guides

Honest scope boundaries: Strictly a Delphi / Object Pascal language, runtime-behavior, and compiler-directive reference — not a VCL, FMX, or FireDAC component API encyclopedia. Does not claim 100% coverage of the language or any ABI; open questions are listed explicitly by name. Independent product, not affiliated with Embarcadero Technologies, Inc.