Icon View Thread

The following is the text of the current message along with any replies. You may reply to this message or any of the other messages by clicking on the reply option next to the message that you wish to reply to.
Messages 1 to 7 of 7 total
Thread String cast warnings with Delphi 2009
Mon, Mar 23 2009 6:26 AMPermanent Link Log in to reply

Jaakko Salmenius
When I compile DBISAM (newest source code) with Delphi 2009 I get dozens of warnings. It seems that the code assings short strings to long and
back without casting. To fix this either perform cast in the code or add compiler directive that disables these warnings.

I don't want to turn of these compler warning in my entire application because sometimes these castings are very very dangerous.

[DCC Warning] Dbisamtb.pas(9829): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9836): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9844): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9851): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9859): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9866): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9897): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9942): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(9949): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(9952): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(9962): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(9963): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(9963): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10009): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(10017): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10022): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10023): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10023): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10439): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10439): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(10835): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(10855): W1057 Implicit string cast from 'ShortString' to 'string'
[DCC Warning] Dbisamtb.pas(10870): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(10929): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11098): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11255): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11402): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11402): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11404): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11404): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
[DCC Warning] Dbisamtb.pas(11405): W1058 Implicit string cast with potential data loss from 'string' to 'ShortString'
Mon, Mar 23 2009 6:37 AMPermanent Link Log in to reply

Jaakko Salmenius
I could not reply to the my previous post so here is new one.

This will do the trick

unit dbisamlb;

{$WARN IMPLICIT_STRING_CAST OFF}
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}

and

unit dbisamtb;

{$WARN IMPLICIT_STRING_CAST OFF}
{$WARN IMPLICIT_STRING_CAST_LOSS OFF}

Please update your source code.

Best regards,
Jaakko
Mon, Mar 23 2009 6:46 AMPermanent Link Log in to reply

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jaakko


I can't say for sure since I've switched over to ElevateDB but I didn't know DBISAM was available for D2009.

Roy Lambert
Mon, Mar 23 2009 1:29 PMPermanent Link Log in to reply

Jan Ferguson

Data Software Solutions, Inc.

Team Elevate Team Elevate

Roy,

Yup...been available since v4.27. The announcement:

"We are pleased to announce that the 4.27 version of the DBISAM VCL
Client-Server with Source product is now available. Please see below
for complete download instructions.

Release Notes
4.27 Release Notes

DBISAM 4.27 introduces support for Delphi 2009. However, this does not
mean that DBISAM now supports Unicode or WideString data storage.
DBISAM is still a 100% ANSI database engine."

--
Regards,
Jan Ferguson [Team Elevate]


Roy Lambert wrote:

<<I didn't know DBISAM was available for D2009.
Mon, Mar 23 2009 2:45 PMPermanent Link Log in to reply

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jaakko,

<< This will do the trick >>

Thanks.  I couldn't find these warnings in the documentation for Delphi
2009, so the warnings stayed in place.  Where did you find them ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Mar 23 2009 9:20 PMPermanent Link Log in to reply

Jaakko Salmenius
> Where did you find them ?

Google search.
http://stackoverflow.com/questions/376785/identifiers-for-delphis-warn-compiler-directive

Best regards,
Jaakko
Tue, Mar 24 2009 5:20 AMPermanent Link Log in to reply

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Jan


I knew I wasn't up to date Smiley

Roy Lambert
Image