http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49560
Summary: -fexec-charset=IBM-1047 makes -Wformat report incorrect warnings Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: jphartm...@gmail.com Created attachment 24612 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24612 Preprocessor output from printf It looks as if the translated form of the format string is used. Removing the substitution parameter clears the warning. ASCII % (0x37) is not likely to be in any string that is converted to EBCDIC. [/home/john/src/cmsh/390] CFLAGS=-Wall make hlo cc -Wall hlo.c -o hlo [/home/john/src/cmsh/390] rm hlo [/home/john/src/cmsh/390] CFLAGS="-fexec-charset=IBM-1047 -Wall" make hlo cc -fexec-charset=IBM-1047 -Wall hlo.c -o hlo hlo.c: In function 'main': hlo.c:17: warning: spurious trailing '%' in format hlo.c:17: warning: too many arguments for format [/home/john/src/cmsh/390] gcc --version gcc (GCC) 4.4.5 20101112 (Red Hat 4.4.5-2) Don't know how RedHat configured the compiler. And also with a 4.6.0 I compiled from unmodified source. --with-gnu-as --with-gnu-ld --prefix=/home/john/pool/360/root/usr --with-sysroot=/home/john/pool/360/root --target=s390x-ibm-linux --enable-languages=c --with-gmp=/usr --with-mpfr=/usr --with-mpc=/usr --disable-libgomp --disable-threads --disable-tls --disable-libada --disable-libssp --disable-shared --without-headers --disable-lto --disable-nls [/home/john/src/cmsh/390] uname -a Linux bigserv 2.6.34.8-68.fc13.x86_64 #1 SMP Thu Feb 17 15:03:58 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux