[Bug c/91206] -Wformat doesn't warn for %hd with char parameter

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jul 18 20:47:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91206

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think GCC is correct as anything shorting than int is prompted to int when
passing via varags.  So %hd will print the int argument as a short.  This is
valid C code.  Maybe there should be a -Wformat=999 for this case but it seems
to be too noisy :).


More information about the Gcc-bugs mailing list