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: unassig...@sourceware.org
        ReportedBy: agar...@igalia.com
    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.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to