This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RFA: c99-printf-1.c Modify Warning Messages
- To: jsm28 at cam dot ac dot uk
- Subject: RFA: c99-printf-1.c Modify Warning Messages
- From: Jeffrey Oldham <oldham at codesourcery dot com>
- Date: Sun, 27 May 2001 17:40:36 -0700
- Cc: Jeffrey Oldham <oldham at codesourcery dot com>, gcc-bugs at gcc dot gnu dot org
- Organization: CodeSourcery LLC
Joseph,
Is the attached patch acceptable? If so, feel free to commit
it. It fixes a gcc 3.0 regression for powerpc-unknown-linux-gnu.
Yesterday, gcc/testsuite/gcc.dg/format/c99-printf-1.c started failing
for powerpc-unknown-linux-gnu:
=== gcc tests ===
FAIL: gcc.dg/format/c99-printf-1.c %hhn unsigned char (test for warnings, line 196)
When using a Linux->powerpc-unknown-linux-gnu cross compiler to
compile the preprocessed source code, the warning messages include:
c99-printf-1.c:195: warning: signed char format, char arg (arg 2)
c99-printf-1.c:196: warning: signed char format, unsigned char arg (arg 2)
I modified the patch to try to match the warning messages. A possible
ChangeLog entry:
2001-05-27 Jeffrey Oldham <oldham@codesourcery.com>
* gcc.dg/format/c99-printf-1.c (foo): Modify regexps for warning
matches.
Thanks,
Jeffrey D. Oldham
oldham@codesourcery.com
Index: c99-printf-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/format/c99-printf-1.c,v
retrieving revision 1.2
diff -c -p -r1.2 c99-printf-1.c
*** c99-printf-1.c 2001/01/07 10:44:59 1.2
--- c99-printf-1.c 2001/05/28 00:30:02
*************** foo (int i, unsigned int u, double d, ch
*** 192,197 ****
by the standard, but a bad idea, so GCC should diagnose if what
is used is not signed char *.)
*/
! printf ("%hhn", s); /* { dg-warning "format" "%hhn plain char" } */
! printf ("%hhn", us); /* { dg-warning "format" "%hhn unsigned char" } */
}
--- 192,197 ----
by the standard, but a bad idea, so GCC should diagnose if what
is used is not signed char *.)
*/
! printf ("%hhn", s); /* { dg-warning "format" "char" } */
! printf ("%hhn", us); /* { dg-warning "format" "unsigned char" } */
}