Improve `cpp/wrong-type-format-argument` by adding correct formatting specifier
Open
question
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 141
Description
**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](https://en.cppreference.com/w/c/io/fprintf) has a great table about which specifier is needed for which type.
Contributor guide
Assessment
This issue has not been assessed yet.