2

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!

santiagoIT
  • 9,411
  • 6
  • 46
  • 57
  • What's wrong with tampering with the code? It's code that came with Delphi XE 2, and it's never going to be used with any other version, so there's no reason not to edit it so it conforms to Delphi XE 2 ideals. (If you upgrade, you'd either use the version of DUnit that comes with that new version, or you'd download a standalone version of DUnit; either way, the changes you make to the XE 2 copy would be isolated and harmless externally.) – Rob Kennedy Dec 06 '13 at 17:47
  • The warning even shows the correct fix so there is nothing even remotely dangerous in applying that fix to the unit. – Stefan Glienke Dec 06 '13 at 18:32
  • @RobKennedy + Stefan The problem is that there are many developers involved, who would also have to make the change, besides all the automated build machines. If it were just me, I would have changed the DUnit code indeed. – santiagoIT Dec 07 '13 at 03:32
  • Then stop using the Delphi-provided code and get the standalone version. Include it in your source control, and then everyone will have the same fixes. – Rob Kennedy Dec 07 '13 at 15:04

3 Answers3

2

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.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
2

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.

Disillusioned
  • 14,635
  • 3
  • 43
  • 77
  • I followed your advice and ended up placing a modified copy of DUnit v 9.4 under source control. BTW, do you happen to know why the latest version available on the DUnit project page is 9.3, but the version shipping with Delphi is 9.4? – santiagoIT Dec 09 '13 at 17:26
  • I wouldn't know. Perhaps there's a fork of the project somewhere else. Another source forge project, or perhaps even github. I do recall that someone started a DUnit2 project some years back. – Disillusioned Dec 09 '13 at 18:08
1

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

:) Kai Inge

  • Since many components must support older delphi versions, this is not always possible, unless you turn off all warnings, something that is not ideal either. – Marco van de Voort Dec 06 '13 at 17:24
  • 2
    Welcome to Stack Overflow. Thanks for sharing your anecdote, but I'm not sure how it answers the question. Could you please expand your answer? – Rob Kennedy Dec 06 '13 at 17:44