diff mbox

Warn for each missing printf argument

Message ID E4965275-325F-45CF-9ED7-4D91D8C61F7B@sandoe-acoustics.co.uk
State New
Headers show

Commit Message

Iain Sandoe Nov. 23, 2010, 5:22 p.m. UTC
On 13 Nov 2010, at 17:16, IainS wrote:

>>> I committed (as obvious) the same adjustment for the identical  
>>> Objective-C++ testcase
>>> to stop the corresponding ObjC++ failure.
>>
>> I'll sort out the corresponding amendments to -fnext-runtime fails
>> (I seem to recall volunteering...)
>
> applied attached @166713

also for Darwin CFString I applied the following as obvious:
r167088
Iain

  			/* { dg-warning "too many arguments for format" "" { target *-*- 
* } 33 } */
-  printf(s5 (1, "and so is this %d %d %s", 3, 4, "hey", 6), 5, 6,  
12);/* { dg-warning "format .%s. expects type .char .., but argument 4  
has type .int." } */
-}
\ No newline at end of file
+  printf(s5 (1, "and so is this %d %d %s", 3, 4, "hey", 6), 5, 6,  
12);/* { dg-warning "format .%s. expects argument of type .char ..,  
but argument 4 has type .int." } */
+}
diff mbox

Patch

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 167085)
+++ gcc/testsuite/ChangeLog	(working copy)
@@ -1,3 +1,7 @@ 
+2010-11-23  Iain Sandoe  <iains@gcc.gnu.org>
+
+	* gcc.dg/darwin-cfstring-1.c: Adjust format messages.
+
  2010-11-23  Jakub Jelinek  <jakub@redhat.com>

  	PR middle-end/46499
Index: gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c
===================================================================
--- gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c	(revision 167085)
+++ gcc/testsuite/gcc.dg/darwin-cfstring-format-1.c	(working copy)
@@ -30,7 +30,7 @@  void foo (void)
  {
    CFStringRef notchk = CFSTR ("here is an unchecked %d %s string");
    s1 (notchk, 5, 6, 7);
-  printf("this one is checked %d %s", 3, 4, 5); /* { dg-warning  
"format .%s. expects type .char .., but argument 3 has type .int." } */
+  printf("this one is checked %d %s", 3, 4, 5); /* { dg-warning  
"format .%s. expects argument of type .char .., but argument 3 has  
type .int." } */