Skip to content

Conversation

@cirras
Copy link
Collaborator

@cirras cirras commented Mar 27, 2025

This PR adds support for the undocumented WEAK_NATIVEINT predefined conditional symbol.
It's defined from Delphi 12 onward.

This was discovered due to a strange false positive on Delphi 12:
image

It turns out that the Delphi 12 RTL still declares TNativeIntHelper and gates it behind this WEAK_NATIVEINT symbol.
Without the symbol defined, the analyzer would see the TNativeIntHelper record helper defined and overriding TIntegerHelper since (as weak aliases) they are the same type now.

This caused the analyzer to think that TNativeIntHelper.Parse was being called, which (of course) returns a NativeInt and confuses the PlatformDependentTruncation check.

@cirras cirras added this to the Delphi 12 Athens milestone Mar 27, 2025
@cirras cirras requested a review from fourls March 27, 2025 04:10
fourls
fourls previously approved these changes Mar 27, 2025
Copy link
Collaborator

@fourls fourls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@cirras cirras merged commit 22b859a into master Mar 28, 2025
4 checks passed
@cirras cirras deleted the weak_nativeint_symbol branch March 28, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants