-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Suppress warnings for taking address of TypedReference #80484
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point soon we may want to just suppress 8500 for the whole repo, but for now doing it locally is good.
Agreed. Do we think this is one of those warnings we want to permit when performed in an |
Right. Previously this was an unsuppressable error. Now in an unsafe context it becomes a suppressable warning CS8500. |
Tagging subscribers to this area: @dotnet/area-system-runtime-compilerservices Issue DetailsRelates to compiler change: dotnet/roslyn#66328
|
S.R.CS seems a resaonable label even though it's not? |
@stephentoub My understanding is that this is generally unsafe, but there are a few situations where it is okay. When it comes to compiler warnings, this is one that is stern :-P |
What are some examples where the warning legitimately protects someone from a bad mistake? (That's a real question; I'm trying to understand how the problems this averts are significantly worse than many other things I can do with pointers in an unsafe context with zero warning.) |
I see your point. This is not worse than other things you can do with pointers in unsafe context. A broader suppression would make sense. |
Relates to compiler change: dotnet/roslyn#66328
Tagging @AaronRobinsonMSFT to confirm those suppressions are okay.