Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6716969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:47:49+00:00 2026-05-26T08:47:49+00:00

The Delphi Linker strips out any functions that aren’t actually used, thus reducing the

  • 0

The Delphi Linker strips out any functions that aren’t actually used, thus reducing the executable size.

Is there any way to stop the Delphi Linker doing this? e.g. a compiler switch?

To those wondering “why?”…

I am trying to use the delphi-code-coverage tool, but it only reports on code that is actually compiled into the executable. Which makes it not very useful. If I could get Delphi to include all code, I’m hoping I could then get some useful code coverage statistics.

I should mention that I have DUnit tests in a separate project to my application. So even though the code is “unused” in the DUnit project, it is used in the actual application.

See here for more details.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:47:50+00:00Added an answer on May 26, 2026 at 8:47 am

    Your code-coverage tool is measuring the wrong thing. It works off the map file instead of the source code, so it will only report on live code instead of on all code in a project. The linker already filters out the dead code, and in a blank unit-test project, all code is dead code. There is no way to tell Delphi to include dead code in an EXE.

    Run the code-coverage tool on your application to get a list of functions that needs testing. Then, write code in your unit-test project that mentions all those functions. (It doesn’t have to call everything yet, and it certainly doesn’t have to test it all. We’re just making sure it’s linked to the unit-test project.) Now the coverage tool can get an accurate measurement of what’s been executed and what hasn’t.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Delphi documentation says that Debug information [...] it does not affect the size or
In Delphi the Image Base linker option defaults to 00400000 . Per the help:
Delphi has a $WARN compiler directive that allows one to selectively enable or disable
I've got some long but simple loops in my Delphi program that may loop
Delphi 7 SQLSERVER 2000 I am having a problem with a legacy application that
I have a C++ Builder DLL that must link against a Delphi package (BPL),
We have a .lib file with functionality that must be included in a Delphi
The Delphi Docwiki explains that Pulse notifies the next thread in the waiting queue
Delphi 7 question. I'm working with a form that has many databound controls (changing
Virtual method interception - introduced with Delphi XE - can be used to 'proxify'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.