From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kA1mKYi1RmMXYQoAWB0awg (envelope-from ) for ; Wed, 12 Oct 2022 08:39:36 -0400 Received: by simark.ca (Postfix, from userid 112) id A75691E112; Wed, 12 Oct 2022 08:39:36 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=NEHrCpRU; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4403E1E0D3 for ; Wed, 12 Oct 2022 08:39:36 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CA1A138207F8 for ; Wed, 12 Oct 2022 12:39:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA1A138207F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665578375; bh=egGD2xUhwn3JzXcCEon9YXtUaUdkAbBlyMtGV5UpctM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NEHrCpRU87xJyl69guGuN+g2ydXSOFOk6bnkpPRvP7tHe1uXEX9CmumXpByrdbXUf hOT2IC5Z+oJIU9eoB6tPPAEv3vR+L5MK8w01PWKo2GUsHvbCluylH0iECuaYd+TzhL VYzFd8AlcgnsE3cwWw6clEzLV3606J+oRtUwRWMA= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 8D395388451B for ; Wed, 12 Oct 2022 12:38:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D395388451B Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-475-cEFjCHYTNG2SXfsLK_m8Yg-1; Wed, 12 Oct 2022 08:38:55 -0400 X-MC-Unique: cEFjCHYTNG2SXfsLK_m8Yg-1 Received: by mail-wm1-f70.google.com with SMTP id k22-20020a05600c0b5600b003c6cf5c5592so436205wmr.3 for ; Wed, 12 Oct 2022 05:38:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=egGD2xUhwn3JzXcCEon9YXtUaUdkAbBlyMtGV5UpctM=; b=7zp1P17U92n5R0q/UgEFn4z/+4OQnSuXFdttmP26zOWe2Um0DLngP5DKogIUrVo4un fKY317GMKGfukuYBNLVsfG7xLmXpUftynJKZ+qy/KQpbIPQvQ/VSvUq4cI8cNeKWgobN 5aySnjqXhwjFFvpPMqfDSz7wDJydFOnN6/DiKNIvBYmVyDmYj1T9OhLjzOLIhP5intso pOFm+02hit7yojIHP88MDW7gdGGUekg/Yys/Dd0P+fwzPJL87kBmAGIk966d2IYhsVB5 r2mgw9zLNFkOnwDiL0n+r0IZu/1Jekskctk/2SeqHlAfttRhHzqI8KAgDxm6luA5bSOm 6czw== X-Gm-Message-State: ACrzQf2q/cS/YWZdLM7RP9mYL1gi0EBkR3nuOskFglHgLi0UVG9lR68Q CfBGXoBErf8c/fgE1eUCmquCk0s38bHQJIyL9FfIah709LXoqZyWOz4txuOMOxDGccUTM9tkWev HJSz5DG76aq0XGtwDwfMsDJBVl7fpJhjBqz+LZRA+iV26ns11fJWvZc7jd2RlZgbIiaDLznTXWQ == X-Received: by 2002:a05:600c:ace:b0:3b4:621f:93f4 with SMTP id c14-20020a05600c0ace00b003b4621f93f4mr2610544wmr.8.1665578333613; Wed, 12 Oct 2022 05:38:53 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6c+ffCr32m7fEa6xubjhItAy16IlWzGwdAVSTJiVtiGTw475sBnkTFRH10VS8BGQOPRHJ58Q== X-Received: by 2002:a7b:cb92:0:b0:3c4:cf60:7a7 with SMTP id m18-20020a7bcb92000000b003c4cf6007a7mr2697039wmi.24.1665578322096; Wed, 12 Oct 2022 05:38:42 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id o14-20020a05600c4fce00b003c6b67426b0sm1835074wmq.12.2022.10.12.05.38.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 05:38:41 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 2/5] sim/ppc: fix warnings related to printf format strings Date: Wed, 12 Oct 2022 13:38:32 +0100 Message-Id: <97bcb87aa4ece94b30b62ec5d1845909dbb933a1.1665578246.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" This commit is a follow on to: commit 182421c9d2eea8c4877d983a2124e591f0aca710 Date: Tue Oct 11 15:02:08 2022 +0100 sim/ppc: fixes for arguments to printf style functions 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. This commit is mostly either changing the format string to match the argument, or in some cases, excess, unused arguments are removed. --- 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 |= generate_with_icache; break; default: - error (NULL, "Expecting -Ggen-icache or -Ggen-icache=\n"); + error ("Expecting -Ggen-icache or -Ggen-icache=\n"); } } } diff --git a/sim/ppc/ld-cache.c b/sim/ppc/ld-cache.c index f57f7db650a..b30b1f4d898 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*)0x%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 0x%p)\n", rule->next); dumpf(indent, " )\n"); } diff --git a/sim/ppc/ld-decode.c b/sim/ppc/ld-decode.c index 68d9f5f4f52..83ff1216b30 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 0x%p)\n", rule->next); } dumpf(indent, " )\n"); } diff --git a/sim/ppc/ld-insn.c b/sim/ppc/ld-insn.c index 3910af3fdf6..c89c81c1073 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*)0x%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); - - dumpf(indent, "(next 0x%x)\n", field->next); - - dumpf(indent, "(prev 0x%x)\n", field->prev); - - + dumpf (indent, "(is_string `%s')\n", field->val_string); + dumpf (indent, "(next 0x%p)\n", field->next); + dumpf (indent, "(prev 0x%p)\n", field->prev); } static void @@ -860,13 +849,13 @@ dump_insn_fields(insn_fields *fields, printf("(insn_fields*)%p\n", fields); - dumpf(indent, "(first 0x%x)\n", fields->first); - dumpf(indent, "(last 0x%x)\n", fields->last); + dumpf(indent, "(first 0x%p)\n", fields->first); + dumpf(indent, "(last 0x%p)\n", fields->last); dumpf(indent, "(value 0x%x)\n", fields->value); for (i = 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"); - 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"); - dumpf(indent, "(sibling ", table->sibling); + dumpf(indent, "(sibling "); dump_insn_table(table->sibling, indent+1, levels-1); dumpf(indent, " )\n"); - dumpf(indent, "(parent ", table->parent); + dumpf(indent, "(parent "); dump_insn_table(table->parent, indent+1, 0); dumpf(indent, " )\n"); -- 2.25.4