]> Git Repo - binutils.git/blobdiff - opcodes/openrisc-opc.c
opcodes/
[binutils.git] / opcodes / openrisc-opc.c
index 9cfa8b91d1df423d08b22d6201c1cd945433b763..c3aa09deda33b2819fb919d795db300e8b5d5e15 100644 (file)
@@ -671,7 +671,10 @@ openrisc_cgen_init_opcode_table (CGEN_CPU_DESC cd)
   const CGEN_OPCODE *oc = & openrisc_cgen_macro_insn_opcode_table[0];
   CGEN_INSN *insns = xmalloc (num_macros * sizeof (CGEN_INSN));
 
-  memset (insns, 0, num_macros * sizeof (CGEN_INSN));
+  /* This test has been added to avoid a warning generated
+     if memset is called with a third argument of value zero.  */
+  if (num_macros >= 1)
+    memset (insns, 0, num_macros * sizeof (CGEN_INSN));
   for (i = 0; i < num_macros; ++i)
     {
       insns[i].base = &ib[i];
This page took 0.021962 seconds and 4 git commands to generate.