Visitar URL original
Improve `cpp/wrong-type-format-argument` by adding correct formatting specifier · Issue #15028 · github/codeql · GitHub
The Wayback Machine - https://web.archive.org/web/20240324153728/https://github.com/github/codeql/issues/15028
Skip to content
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

Improve cpp/wrong-type-format-argument by adding correct formatting specifier #15028

Open
AMS21 opened this issue Dec 6, 2023 · 1 comment
Open
Labels
question Further information is requested

Comments

@AMS21
Copy link

AMS21 commented Dec 6, 2023

Description of the issue
Currently the cpp/wrong-type-format-argument diagnostic displays something like this

This argument should be of type 'int' but is of type 'unsigned long'.

It would be even more helpful if the diagnostic message would include the correct formatting specifier so it would look something like this:

This argument should be of type 'int' but is of type 'unsigned long'. Consider using '%ul' instead.

For reference cppreference has a great table about which specifier is needed for which type.

@AMS21 AMS21 added the question Further information is requested label Dec 6, 2023
@MathiasVP
Copy link
Contributor

Hi @AMS21,

That's a great suggestion. Thank you! I've recorded this in an internal issue 🙂.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants