make dep-am and regen
[binutils-gdb.git] / opcodes / fr30-opc.c
index ca80aaadacbf0f93c03c02dc98b81b0076e7df7a..6d99258e09b4d4923c760e0262f7059b983e2664 100644 (file)
@@ -1361,7 +1361,10 @@ fr30_cgen_init_opcode_table (CGEN_CPU_DESC cd)
   const CGEN_OPCODE *oc = & fr30_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];