bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/14837] New: Variable passed to printf-like function without for


From: agarcia at igalia dot com
Subject: [Bug gas/14837] New: Variable passed to printf-like function without format argument
Date: Tue, 13 Nov 2012 15:25:33 +0000

http://sourceware.org/bugzilla/show_bug.cgi?id=14837

             Bug #: 14837
           Summary: Variable passed to printf-like function without format
                    argument
           Product: binutils
           Version: 2.23
            Status: NEW
          Severity: minor
          Priority: P2
         Component: gas
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


gcc complains because as_warn() is receiving a variable without a format
argument.

In this case none of the 3 possible values of the variable is dangerous
(they're set a few lines earlier in the same function) but gcc complains
anyway:

config/tc-z80.c: In function 'wrong_mach':
config/tc-z80.c:470:5: error: format not a string literal and no format
arguments [-Werror=format-security]

This patch fixes the warning:

--- tc-z80.c.orig       2012-11-13 15:20:18.000000000 +0000
+++ tc-z80.c    2012-11-13 15:21:49.000000000 +0000
@@ -467,7 +467,7 @@
   if (ins_type & ins_err)
     error (_(p));
   else
-    as_warn (_(p));
+    as_warn ("%s", _(p));
 }

 static void

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]