From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id 101643858291; Wed, 19 Oct 2022 13:32:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 101643858291 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666186373; bh=XesuOds3wSNHKB6Fflu6Aifh46NYq5YCJGzdwJaN9YM=; h=From:To:Subject:Date:From; b=UJ46cyBpLu8XIw5oL6uBzWmLSEbjoHWPqX3d/jNsr/enFyVKeOok6DFXyNBIEu2oc Toa+0xBILWDBcZra8wY8xHdf0HRa3TH2Q3nE7KChBLpOmFbs+roQMMlaYlRo556iXd B1GyDlqdq/ZqKfm4/PuFUV6HT9u0SJBiCu1K93NA= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] sim/ppc: fix warnings related to printf format strings X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: cb9d1609da6e623158ba5a8cb4a2712bcea4f57f X-Git-Newrev: 744875dfdc94dc397ae666c65c56b416c3a191db Message-Id: <20221019133253.101643858291@sourceware.org> Date: Wed, 19 Oct 2022 13:32:53 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D744875dfdc94= dc397ae666c65c56b416c3a191db commit 744875dfdc94dc397ae666c65c56b416c3a191db Author: Andrew Burgess Date: Wed Oct 12 11:09:35 2022 +0100 sim/ppc: fix warnings related to printf format strings =20 This commit is a follow on to: =20 commit 182421c9d2eea8c4877d983a2124e591f0aca710 Date: Tue Oct 11 15:02:08 2022 +0100 =20 sim/ppc: fixes for arguments to printf style functions =20 where commit 182421c9d2ee addressed issues with printf format arguments that were causing the compiler to give an error, this commit addresses issues that caused the compiler to emit a warning. =20 This commit is mostly either changing the format string to match the argument, or in some cases, excess, unused arguments are removed. Diff: --- sim/ppc/igen.c | 2 +- sim/ppc/ld-cache.c | 4 ++-- sim/ppc/ld-decode.c | 2 +- sim/ppc/ld-insn.c | 41 +++++++++++++++-------------------------- 4 files changed, 19 insertions(+), 30 deletions(-) diff --git a/sim/ppc/igen.c b/sim/ppc/igen.c index 6a6dbc30f31..27b48638276 100644 --- a/sim/ppc/igen.c +++ b/sim/ppc/igen.c @@ -442,7 +442,7 @@ main(int argc, code |=3D generate_with_icache; break; default: - error (NULL, "Expecting -Ggen-icache or -Ggen-icache=3D= \n"); + error ("Expecting -Ggen-icache or -Ggen-icache=3D\n"); } } } diff --git a/sim/ppc/ld-cache.c b/sim/ppc/ld-cache.c index f57f7db650a..9a78f908b05 100644 --- a/sim/ppc/ld-cache.c +++ b/sim/ppc/ld-cache.c @@ -88,13 +88,13 @@ static void dump_cache_rule(cache_table* rule, int indent) { - dumpf(indent, "((cache_table*)0x%x\n", rule); + dumpf(indent, "((cache_table*)%p\n", rule); dumpf(indent, " (type %s)\n", i2name(rule->type, cache_type_map)); dumpf(indent, " (field_name \"%s\")\n", rule->field_name); dumpf(indent, " (derived_name \"%s\")\n", rule->derived_name); dumpf(indent, " (type-def \"%s\")\n", rule->type_def); dumpf(indent, " (expression \"%s\")\n", rule->expression); - dumpf(indent, " (next 0x%x)\n", rule->next); + dumpf(indent, " (next %p)\n", rule->next); dumpf(indent, " )\n"); } =20 diff --git a/sim/ppc/ld-decode.c b/sim/ppc/ld-decode.c index 68d9f5f4f52..63c2c2e53d4 100644 --- a/sim/ppc/ld-decode.c +++ b/sim/ppc/ld-decode.c @@ -120,7 +120,7 @@ dump_decode_rule(decode_table *rule, dumpf(indent, " (special_mask 0x%x)\n", rule->special_mask); dumpf(indent, " (special_value 0x%x)\n", rule->special_value); dumpf(indent, " (special_constant 0x%x)\n", rule->special_constant); - dumpf(indent, " (next 0x%x)\n", rule->next); + dumpf(indent, " (next %p)\n", rule->next); } dumpf(indent, " )\n"); } diff --git a/sim/ppc/ld-insn.c b/sim/ppc/ld-insn.c index 3910af3fdf6..a94464d44bb 100644 --- a/sim/ppc/ld-insn.c +++ b/sim/ppc/ld-insn.c @@ -827,29 +827,18 @@ static void dump_insn_field(insn_field *field, int indent) { - - printf("(insn_field*)0x%lx\n", (unsigned long)field); - - dumpf(indent, "(first %d)\n", field->first); - - dumpf(indent, "(last %d)\n", field->last); - - dumpf(indent, "(width %d)\n", field->width); - + printf ("(insn_field*)%p\n", field); + dumpf (indent, "(first %d)\n", field->first); + dumpf (indent, "(last %d)\n", field->last); + dumpf (indent, "(width %d)\n", field->width); if (field->is_int) - dumpf(indent, "(is_int %d)\n", field->val_int); - + dumpf (indent, "(is_int %d)\n", field->val_int); if (field->is_slash) - dumpf(indent, "(is_slash)\n"); - + dumpf (indent, "(is_slash)\n"); if (field->is_string) - dumpf(indent, "(is_string `%s')\n", field->val_string); - =20 - dumpf(indent, "(next 0x%x)\n", field->next); - =20 - dumpf(indent, "(prev 0x%x)\n", field->prev); - =20 - + dumpf (indent, "(is_string `%s')\n", field->val_string); + dumpf (indent, "(next %p)\n", field->next); + dumpf (indent, "(prev %p)\n", field->prev); } =20 static void @@ -860,13 +849,13 @@ dump_insn_fields(insn_fields *fields, =20 printf("(insn_fields*)%p\n", fields); =20 - dumpf(indent, "(first 0x%x)\n", fields->first); - dumpf(indent, "(last 0x%x)\n", fields->last); + dumpf(indent, "(first %p)\n", fields->first); + dumpf(indent, "(last %p)\n", fields->last); =20 dumpf(indent, "(value 0x%x)\n", fields->value); =20 for (i =3D 0; i < insn_bit_size; i++) { - dumpf(indent, "(bits[%d] ", i, fields->bits[i]); + dumpf(indent, "(bits[%d]", i); dump_insn_field(fields->bits[i], indent+1); dumpf(indent, " )\n"); } @@ -961,16 +950,16 @@ dump_insn_table(insn_table *table, dump_opcode_field(table->opcode, indent+1, 1); dumpf(indent, " )\n"); =20 - dumpf(indent, "(nr_entries %d)\n", table->entries); + dumpf(indent, "(nr_entries %d)\n", table->nr_entries); dumpf(indent, "(entries "); dump_insn_table(table->entries, indent+1, table->nr_entries); dumpf(indent, " )\n"); =20 - dumpf(indent, "(sibling ", table->sibling); + dumpf(indent, "(sibling "); dump_insn_table(table->sibling, indent+1, levels-1); dumpf(indent, " )\n"); =20 - dumpf(indent, "(parent ", table->parent); + dumpf(indent, "(parent "); dump_insn_table(table->parent, indent+1, 0); dumpf(indent, " )\n");