-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler warnings raise when build cloop generated Firebird.pas in RAD Studio 11.3 #7542
Comments
The warnings are true. Other warnings are really important, as result of functions are undefinded, exception is not reraised only put into status vector. |
Could you check this file ? |
@hvlad . Thank you. The patch
These are the compiler warnings:
I suggest these warning
For warning
The patches shall render 0 compiler warnings clean code. |
I see no good way of how to avoid String -> AnsiString cast in first case. Other warnings should be fixed now, check new version, pls: Firebird.zip |
You do not need to avoid it, simly add explicit cast. String(varOrExpression) or AnsiString(varOrExpression)Regards,Karol Bieniaszewski
-------- Oryginalna wiadomość --------Od: Vlad Khorsun ***@***.***> Data: 9.04.2023 23:03 (GMT+01:00) Do: FirebirdSQL/firebird ***@***.***> DW: Karol Bieniaszewski ***@***.***>, Comment ***@***.***> Temat: Re: [FirebirdSQL/firebird] Compiler warnings raise when build cloop generated Firebird.pas in RAD Studio 11.3 (Issue #7542)
For warning [dcc32 Warning] Firebird.pas(16347): W1058 Implicit string cast with potential data loss from 'string' to 'AnsiString', I think the msg variable isn't use. These 2 lines may remove from the code:
msg := e.message;
msg := interfaceName;
msg variable is used to convert String to the AnsiString, as we don't put non-ansi strings into status-vector.
I see no good way of how to avoid String -> AnsiString cast in first case.
In the second case, I've changed declaration of interfaceName and removed 'msg' as not needed.
Other warnings should be fixed now, check new version, pls: Firebird.zip
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
@hvlad Your patch is greatly improve now. The patch left only one compiler warning:
I suggest you may patch by removing
A full example:
|
Does Delphi guarantee that the temporary string created by cast is valid until end of block? AFAIK - no, so this code is using already freed memory garbage. Variable msg is needed to prevent that. |
…d Firebird.pas in RAD Studio 11.3 Also, fixed AV in FbException.catchException()
Could somebody check it ? |
Yes, he's right. |
Thanks, the code is fixed already. |
Can the patch ported to v4.0-release branch? |
…d Firebird.pas in RAD Studio 11.3 Also, fixed AV in FbException.catchException()
Sure, done |
Lot of compiler warnings raise when build src/include/gen/Firebird.pas in RAD Studio 11.3:
The text was updated successfully, but these errors were encountered: