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

  • Home
  • SEARCH
  • 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 6097053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:59:54+00:00 2026-05-23T12:59:54+00:00

So I am including in my unit some other units and after building application

  • 0

So I am including in my unit some other units and after building application I receive a huge amount of warnings from those units. The amount is so large that I’am having problems in finding my own warnings on the list. 😉

Is there some compiler directive which would allow me to turn those warnings off? But please note, that I don’t want to modify those units in any way. I would like to achieve something like this:

unit MyUnit;

interface

uses
  UnitA, {$WARN EMIT_WARNNIGS OFF} UnitB, {$WARN EMIT_WARNNIGS ON} UnitC, UnitD.

implementation

uses
  UnitE, {$WARN EMIT_WARNNIGS OFF} UnitF, UnitG, {$WARN EMIT_WARNNIGS ON} UnitH.

This is an imaginary compiler directive which I would like to have, or maybe it exists and I don’t know about it?

Thanks for your time.

  • 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-23T12:59:55+00:00Added an answer on May 23, 2026 at 12:59 pm

    There is a compiler directive to turn warnings off, but this can only be set in either project options in which case it applies to all units, or in a unit itself in which case it applies to that unit alone.

    So, you’re left with a few options.

    Unrealistic option that does exactly what you ask:

    So the only solution would be to disable warnings in your project and then enable them in all your own units using that directive.

    Easiest and most realistic option:

    Compile the units once and only use the DCUs by removing the source from your library path. That’s easiest if you do not want to edit them anyway.

    You can still add them in your browsing path which is different from the library path. In that case, the DCUs are used, but Delphi can still find the sources, so you can still navigate them whilst debugging.

    Small advantage is that building your project is faster too, because these units don’t need to be recompiled on each build.

    Best option:

    Stop using those units at all. Units with so many warnings are inferior software and can cause serious problems.

    Other solutions:

    • Set aside your wishes of not modifying the units and add the compiler directives to those units anyway
    • Solve the warnings
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building an application using MVC3, Razor view engine, Repository Pattern with Unit
Steps: Run the build including unit tests. Expected result: the unit tests are executed
when including libraries c, the line does not end with a semicolon, while other
Is including a application package prefix while defining a custom action string is convention
I'm writing some unit tests and I need to be able to Assert whether
I'm trying to write some unit tests for a JPA model that I've built
I'm learning Mockito. Before starting to use mock objects I had some Unit tests
I'm using the JavaScript support in javax.script to do some basic unit testing of
I'm porting some code from one framework library to another, which requires me to
I am writing unit tests for some of my code and have run into

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.