diff mbox

Warn for each missing printf argument

Message ID 4CDEA7A4.2070909@gnu.org
State New
Headers show

Commit Message

Paolo Bonzini Nov. 13, 2010, 2:58 p.m. UTC
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

Comments

H.J. Lu Nov. 13, 2010, 3:22 p.m. UTC | #1
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. UTC | #2
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
diff mbox

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