Patchwork Warn for each missing printf argument

login
register
mail settings
Submitter Paolo Bonzini
Date Nov. 13, 2010, 2:58 p.m.
Message ID <4CDEA7A4.2070909@gnu.org>
Download mbox | patch
Permalink /patch/71053/
State New
Headers show

Comments

Paolo Bonzini - Nov. 13, 2010, 2:58 p.m.
On 11/13/2010 03:26 PM, H.J. Lu wrote:
> I think you missed one ObjC testcase:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46463

Yeah, it's new since I submitted the patch.

This fixes it.

2010-11-13  Paolo Bonzini  <bonzini@gnu.org>

	* objc.dg/attributes/method-format-1.m: New test.



Paoo
H.J. Lu - Nov. 13, 2010, 3:22 p.m.
On Sat, Nov 13, 2010 at 6:58 AM, Paolo Bonzini <bonzini@gnu.org> wrote:
> On 11/13/2010 03:26 PM, H.J. Lu wrote:
>> I think you missed one ObjC testcase:
>>
>> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46463
>
> Yeah, it's new since I submitted the patch.
>
> This fixes it.
>
> 2010-11-13  Paolo Bonzini  <bonzini@gnu.org>
>
>        * objc.dg/attributes/method-format-1.m: New test.
                                                                 ^^^^^^^^^^^^^

This isn't a new test.


H.J.
--
>
> Index: testsuite/objc.dg/attributes/method-format-1.m
> ===================================================================
> --- testsuite/objc.dg/attributes/method-format-1.m      (revision 166700)
> +++ testsuite/objc.dg/attributes/method-format-1.m      (working copy)
> @@ -27,17 +27,17 @@ void test (LogObject *object)
>  {
>   [object log: 2  message: "attribute only applies to variadic functions"];
>   [object log: 2  message: "attribute %s only applies to variadic functions", "'format'"];
> -  [object log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
> +  [object log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
>
>   [object debug: "attribute only applies to variadic functions"];
>   [object debug: "attribute %s only applies to variadic functions", "'format'"];
> -  [object debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
> +  [object debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
>
>   [LogObject log: 2  message: "attribute only applies to variadic functions"];
>   [LogObject log: 2  message: "attribute %s only applies to variadic functions", "'format'"];
> -  [LogObject log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
> +  [LogObject log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
>
>   [LogObject debug: "attribute only applies to variadic functions"];
>   [LogObject debug: "attribute %s only applies to variadic functions", "'format'"];
> -  [LogObject debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
> +  [LogObject debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
>  }
>
> Paoo
>
Paolo Bonzini - Nov. 13, 2010, 3:59 p.m.
On 11/13/2010 04:22 PM, H.J. Lu wrote:
>> >  2010-11-13  Paolo Bonzini<bonzini@gnu.org>
>> >
>> >          * objc.dg/attributes/method-format-1.m: New test.
>                                                                   ^^^^^^^^^^^^^
>
> This isn't a new test.

I had fixed the pasto before committing, thanks for pointing it out though.

Paolo

Patch

Index: testsuite/objc.dg/attributes/method-format-1.m
===================================================================
--- testsuite/objc.dg/attributes/method-format-1.m	(revision 166700)
+++ testsuite/objc.dg/attributes/method-format-1.m	(working copy)
@@ -27,17 +27,17 @@  void test (LogObject *object)
 {
   [object log: 2  message: "attribute only applies to variadic functions"];
   [object log: 2  message: "attribute %s only applies to variadic functions", "'format'"];
-  [object log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
+  [object log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
 
   [object debug: "attribute only applies to variadic functions"];
   [object debug: "attribute %s only applies to variadic functions", "'format'"];
-  [object debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
+  [object debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
 
   [LogObject log: 2  message: "attribute only applies to variadic functions"];
   [LogObject log: 2  message: "attribute %s only applies to variadic functions", "'format'"];
-  [LogObject log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
+  [LogObject log: 2  message: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
 
   [LogObject debug: "attribute only applies to variadic functions"];
   [LogObject debug: "attribute %s only applies to variadic functions", "'format'"];
-  [LogObject debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "too few arguments for format" } */
+  [LogObject debug: "attribute %s only applies to variadic functions"]; /* { dg-warning "expects a matching" } */
 }