Skip to content

Fix comments with name of CA2020 rule #118316

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

Closed
wants to merge 1 commit into from

Conversation

xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Aug 3, 2025

No description provided.

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 3, 2025
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Aug 3, 2025
@@ -473,7 +473,7 @@ public static void WriteIntPtr(IntPtr ptr, int ofs, IntPtr val)
#if TARGET_64BIT
WriteInt64(ptr, ofs, (long)val);
#else // 32
#pragma warning disable CA2020 // Prevent from behavioral change
#pragma warning disable CA2020 // Prevent behavioral change
Copy link
Member

Choose a reason for hiding this comment

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

Can we get rid of these pragma warning disable instead? E.g. WriteInt32(ptr, ofs, (int)(nint)val);?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we change the method signature to:

public static void WriteIntPtr(IntPtr ptr, int ofs, nint val)

Copy link
Member

Choose a reason for hiding this comment

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

Sounds reasonable to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did this for all Marshal methods where appropriate: #118335

Copy link
Contributor Author

Choose a reason for hiding this comment

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

And Interlocked: #118336

@jkotas jkotas added area-System.Runtime and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Aug 3, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-runtime
See info in area-owners.md if you want to be subscribed.

@jkotas
Copy link
Member

jkotas commented Aug 4, 2025

Superseded by the two PRs linked above

@jkotas jkotas closed this Aug 4, 2025
@xtqqczze xtqqczze deleted the CA2020-message branch August 4, 2025 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Runtime community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants