12

We have some legacy code that compiles in Delphi 6. There are plans to rewrite it in a more current IDE, but they are a ways out.

When we compile it we get several warnings like this:

FPrecision is specific to a platform.

This is in VCL\DB.pas. (Not our file.) FPrecision is defined like this:

FPrecision Integer Platform

I can see why it is platform specific, but I don't really see what to do about it.

This only started happening when we moved to Windows 7 to develop on.

I saw this question, but the solution does not work for me. I cannot add the pre-compiler tags to DB.pas and the project file does not have any options (that I can see) to suppress just this warning.

Is my only option to turn off all warnings or live with it?

Community
  • 1
  • 1
Vaccano
  • 70,257
  • 127
  • 405
  • 747
  • Can't you turn off a specific Warning? IIRC there is a checkbox-list somewhere. – Henk Holterman Oct 06 '10 at 19:05
  • @Henk Holterman - If you can point me to the list (in Delphi 6 sadly) then that would be the answer. – Vaccano Oct 06 '10 at 20:02
  • Too long ago. But it is very safe to ignore, Delphi 6 was the CLX experiment and this just means "not on Linux". I'm quite sure there is a setting. A second tab on the compiler/build settings maybe. Prob project specific. – Henk Holterman Oct 06 '10 at 20:08
  • Check the answers to this question http://stackoverflow.com/questions/870862/delphi-compiler-warnings-pointing-to-delphis-own-units – mjn Oct 09 '10 at 19:43

2 Answers2

18

If you develop only for specific platform open project source (Project > View source) and add

{$WARN SYMBOL_PLATFORM OFF}
luchaninov
  • 5,986
  • 6
  • 53
  • 75
  • 2
    also {$WARN UNIT_PLATFORM OFF} can be useful to get rid of the warning for example when using FileCtrl unit. – HpTerm Dec 09 '14 at 09:49
3

You can safely ignore the platform warnings. Delphi 6 and 7 was developed at the time, when Borland was experimenting with Kylix to provide a way to write cross-platform Delphi programs. The items marked as platform were platform-dependent, usually (but not limited to) concerning file access routines and constants. The Kylix project failed and is no longer supported, so even if you wanted to, there is no way to compile the code onto platform other than win32. I'm not entirely sure, but as far as I remember, there are no more platform warnings in later versions of the IDE (please correct me if I'm wrong).

Best regards -- Spook.

Spook
  • 22,911
  • 14
  • 79
  • 146
  • 1
    You're wrong. They're still there but project files have platform warnings turned off by default. Those warnings will likely play an important role again if/when Embarcadero gets Mac development out the door. – Kenneth Cochran Jan 07 '11 at 23:47
  • 1
    Well, effectively, if they are disabled by default, that's almost as if there was no warnings at all :) Basing on past Borland/CodeGear/Embarcadero strategy, I would vote on 'if' rather than on 'when'. Well, the bottomline is, that if you do not intend to develop applications outside the win32 world, you can safely ignore all platform warnings. Best regards -- Spook. – Spook Jan 08 '11 at 10:13
  • 1
    Now (Delphi XE7) they are valid again. – Z80 Mar 17 '15 at 11:36