-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Treat SYSLIB1092 as error in sources #122756
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
base: main
Are you sure you want to change the base?
Conversation
|
Can we treat these as errors so that they do not come back? Are there more outside corelib? |
d9b36df to
13c505d
Compare
Enabled rule and fixed existing sources. |
| [return: MarshalUsing(typeof(UniqueComInterfaceMarshaller<IErrorInfo>))] | ||
| IErrorInfo GetErrorInfo( | ||
| [PreserveSig] | ||
| System.Data.OleDb.OleDbHResult GetErrorInfo( |
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.
[In][Out] weren't enough for COM as it was issuing another warning, so I had to align its with other methods in this file; PreserveSig+outarg (it was an odd one out).
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.
What warning were you seeing before switching this to PreserveSig?
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.
It looked different from the others:
error SYSLIB1092: The return value in the managed definition will be converted to an 'out' parameter when calling the unmanaged COM method. If the return value is intended to be the HRESULT code returned by the unmanaged COM method, use '[PreserveSig]' on the method. (https://learn.microsoft.com/dotnet/fundamentals/syslib-diagnostics/syslib1092)
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.
I thought that one should only fire on return types of "int" or "int"-sized enums...
We shouldn't be forcing everyone to use PreserveSig.
Fix #122755.