github / github/codeql

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

オープン
#15,028 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

**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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。