[PATCH] D66186: [Sema] Don't warn on printf('%hd', [char]) (PR41467)

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 16 06:53:58 PDT 2019


aaron.ballman requested changes to this revision.
aaron.ballman added a comment.

In D66186#1632440 <https://reviews.llvm.org/D66186#1632440>, @Nathan-Huckleberry wrote:

> As far as I can tell this case was just overlooked. The original commit adding this change https://reviews.llvm.org/rG0208793e41018ac168412a3da8b2fba70aba9716 only allows chars to int and chars to chars. Another commit ignores typing of chars https://reviews.llvm.org/rG74e82bd190017d59d5d78b07dedca5b06b4547da. I did not see anything related to this particular case in previous commits.


Hmm, it looks like, at least from this review, someone thought the behavior was for demonstrating user intent: http://llvm.org/viewvc/llvm-project?view=revision&revision=157961.

I've convinced myself that -Wformat should disable that diagnostic by default, but there is utility in keeping it exposed through a different format warning flag. It seems like `-Wformat-pedantic` should still diagnose this case.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66186/new/

https://reviews.llvm.org/D66186





More information about the cfe-commits mailing list