Delphi -> disable deprecated warnings from external Units

3.5k views Asked by At

I have a XE2 test project (DUnit). All works and compiles fine. However we have one warning that I have not been able to eliminate:

[DCC Warning] GUITestRunner.pas(1237): W1000 Symbol 'TimeSeparator' is deprecated: 'Use FormatSettings.TimeSeparator'

The problem however is that this code comes from GUITestRunner which is bundled with XE2: **

\Embarcadero\RAD Studio\9.0\source\DUnit\src**GUITestRunner**

**.

I did try using {$WARN SYMBOL_DEPRECATED OFF} in our .dpr file. However this only works with the current assembly.

Do you know of any way of getting rid of that warning besides tampering with the code which comes bundled with XE2?

Thanks a lot!

3

There are 3 answers

2
Disillusioned On BEST ANSWER

You should be able to eliminate the warning by simply linking a pre-compiled DCU instead of recompiling the PAS file.

But...
There's nothing wrong with modifying third-party code to fix the warning. I've encountered a number of small deficiencies in DUnit that I chose to fix in the original units.

Advice for making changes to DUnit:

  • Don't modify the files in the installation folder.
  • Rather make a copy to a new location, and refer your projects to the new location.
  • You'll want the new location under source control (as with any other source).
  • This allows you to keep a record of any changes you do make; so if you get an update of DUnit, you can easily reapply your custom changes.
  • Of course you might want to keep changes made directly in DUnit files to a minimum so as to reduce effort of updating the library. I.e. For each considered change to DUnit, figure out if there might be a suitable alternate way to effect the change without direct modifications.

EDIT

With regard your concern about other developers and the build machines: All the more reason to get the change under you shared source-control.

0
Marco van de Voort On

It's true that directives only apply to the unit they are in, except a few that affect linking.

I don't know about XE2, but in XE3 you can configure in "project options" -> "delphi compiler" -> "hints and warnings" and turn various warnings on and off on a project global level.

2
user3075344 On

I got this error with a DateTimePicker. 'W1000 symbol deprecated'. The solution was to use the updated DateTimeEdit instead. (Using Raize components.)

:) Kai Inge