[Bug c/95588] New: No warning in -Wformat for narrowing formats
nhuck at google dot com
gcc-bugzilla@gcc.gnu.org
Mon Jun 8 19:15:26 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95588
Bug ID: 95588
Summary: No warning in -Wformat for narrowing formats
Product: gcc
Version: 11.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: nhuck at google dot com
Target Milestone: ---
When using formats that cause narrowing conversion gcc does not output any
warnings with -Wformat.
//No warning
#include <stdio.h>
void go(int x) {
printf("%hhx", x);
}
This seems like a valid case for a warning.
Discussion on related issues:
https://lkml.org/lkml/2019/4/11/639
https://github.com/ClangBuiltLinux/linux/issues/378
More information about the Gcc-bugs
mailing list