This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
fix powerpc build
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: binutils <binutils at sources dot redhat dot com>
- Date: Mon, 09 Feb 2009 14:49:54 +0000
- Subject: fix powerpc build
Newer GCC's complain about passing non-constant strings to printf-like
functions. With -Werror binutils fails to build.
This patch fixes it for powerpc-elf, ok?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery
2009-02-09 Nathan Sidwell <nathan@codesourcery.com>
* config/tc-ppc.c (ppc_insert_operand, md_assemble): Use '%s' for
as_bad calls to silence compiler warning.
Index: config/tc-ppc.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-ppc.c,v
retrieving revision 1.145
diff -c -3 -p -r1.145 tc-ppc.c
*** config/tc-ppc.c 15 Jan 2009 12:42:52 -0000 1.145
--- config/tc-ppc.c 9 Feb 2009 14:47:25 -0000
*************** ppc_insert_operand (unsigned long insn,
*** 1632,1638 ****
errmsg = NULL;
insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg);
if (errmsg != (const char *) NULL)
! as_bad_where (file, line, errmsg);
}
else
insn |= ((long) val & operand->bitm) << operand->shift;
--- 1632,1638 ----
errmsg = NULL;
insn = (*operand->insert) (insn, (long) val, ppc_cpu, &errmsg);
if (errmsg != (const char *) NULL)
! as_bad_where (file, line, "%s", errmsg);
}
else
insn |= ((long) val & operand->bitm) << operand->shift;
*************** md_assemble (char *str)
*** 2363,2369 ****
{
insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg);
if (errmsg != (const char *) NULL)
! as_bad (errmsg);
continue;
}
--- 2363,2369 ----
{
insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg);
if (errmsg != (const char *) NULL)
! as_bad ("%s", errmsg);
continue;
}
*************** md_assemble (char *str)
*** 2376,2382 ****
{
insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg);
if (errmsg != (const char *) NULL)
! as_bad (errmsg);
}
if ((operand->flags & PPC_OPERAND_NEXT) != 0)
next_opindex = *opindex_ptr + 1;
--- 2376,2382 ----
{
insn = (*operand->insert) (insn, 0L, ppc_cpu, &errmsg);
if (errmsg != (const char *) NULL)
! as_bad ("%s", errmsg);
}
if ((operand->flags & PPC_OPERAND_NEXT) != 0)
next_opindex = *opindex_ptr + 1;