This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/65446] Improve -Wformat-signedness
- From: "eblake at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 21 May 2015 17:26:36 +0000
- Subject: [Bug c/65446] Improve -Wformat-signedness
- Auto-submitted: auto-generated
- References: <bug-65446-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65446
--- Comment #4 from Eric Blake <eblake at redhat dot com> ---
Arguably, "%u" with short should warn, while "%hu" with short should not. On
the other hand, if I use "%hu" with int, it is unclear to me whether I should
get a warning (the fact that I'm using %h to intentionally truncate the value
before it is printed, even though %hu and %hd print different values, makes it
hard to discern whether I have a mismatch). But this does mean that whatever
changes are made to -Wformat-signedness, it should take into account the use of
%h range-limiting vs. pre-integer-promotion types.