This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RFA: c99-printf-1.c Modify Warning Messages


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" } */
  }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]