-
Notifications
You must be signed in to change notification settings - Fork 1.8k
CPP: WrongTypeFormatArguments.ql Improvements #1255
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
Conversation
@@ -1,5 +1,7 @@ | |||
| tests.cpp:18:15:18:22 | Hello | This argument should be of type 'char *' but is of type 'char16_t *' | | |||
| tests.cpp:19:15:19:22 | Hello | This argument should be of type 'char *' but is of type 'wchar_t *' | | |||
| tests.cpp:21:15:21:21 | Hello | This argument should be of type 'char16_t *' but is of type 'char *' | | |||
| tests.cpp:21:15:21:21 | Hello | This argument should be of type 'wchar_t *' but is of type 'char *' | |
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.
Do you know how this will render in LGTM? One message with two values, or two separate messages on the same line?
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.
On LGTM it'll be one alert with an expandable placeholder that says [ 2 values ]
. Here's an example from a Java query.
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.
LGTM, but the test failed.
645945b
to
29f13fe
Compare
…ne possible expected argument type.
29f13fe
to
1ee28fa
Compare
Ongoing improvements to this query:
restrict
qualified typesI
,I32
,I64
andq
length specifiersI
(see for example lines 2264, 2265 here: https://lgtm.com/projects/g/dotnet/coreclr/snapshot/3ba12824b9169f62223248deb26975fa0c4d27b1/files/src/gcinfo/gcinfoencoder.cpp?sort=name&dir=ASC&mode=heatmap#L2264)