From patchwork Thu Oct 10 23:54:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Wilson X-Patchwork-Id: 34912 Received: (qmail 44845 invoked by alias); 10 Oct 2019 23:55:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 44837 invoked by uid 89); 10 Oct 2019 23:55:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=H*f:sk:CAFyWVa, H*i:sk:CAFyWVa, Writing X-HELO: mail-pl1-f194.google.com Received: from mail-pl1-f194.google.com (HELO mail-pl1-f194.google.com) (209.85.214.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 Oct 2019 23:55:01 +0000 Received: by mail-pl1-f194.google.com with SMTP id q15so3561337pll.11 for ; Thu, 10 Oct 2019 16:55:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ihGkbszgGWAQyqKqUbbV/xpjlagKxjV1jsd+sLiFrTo=; b=GD2cdptrLBiopYeyCBw+EKA/5Rl6kBaBwEf05kpyTYpidgzV3DRUT1gZvOQUYn/pk7 WLmL+VzUbewLtcD29ZnzI39z/vjaCOMO8ezVRi5jRQ8ep22hLpZcU/DF/7pmudh/4DKV MT+T8slhOjDZHEYWHMGXCjrLHT5U2ANyqNX4nGxsaVZT26/laQoktXId1pykdiDtRJRo vWRGqrB10ZP7TKOvBGRLygud6Y5EEG44pw7ifqWlraiZJb62wimK//wxixsFADUcoTqE dJ9y1WMu1kfbq3UcVrUhPhI0AkhZ56DWTogC0A0uCvXi3dEYryRT4aVw1cNkA2sPrD6a fe7g== Return-Path: Received: from rohan.sifive.com ([12.206.222.5]) by smtp.gmail.com with ESMTPSA id q15sm7016454pgl.12.2019.10.10.16.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Oct 2019 16:54:59 -0700 (PDT) From: Jim Wilson To: gdb-patches@sourceware.org Cc: Jim Wilson Subject: [PATCH 1/2] RISC-V: Fix two ARI warnings. Date: Thu, 10 Oct 2019 16:54:55 -0700 Message-Id: <20191010235455.27036-1-jimw@sifive.com> In-Reply-To: References: X-IsSubscribed: yes > gdb/riscv-tdep.c:1657: code: %ll: Do not use printf(%ll), instead use printf(%s,phex()) to dump a 'long long' value gdb/riscv-tdep.c:1657: "Writing %lld-byte nop instruction to %s: %s\n", > gdb/riscv-tdep.c:1658: code: long long: Do not use 'long long', instead use LONGEST gdb/riscv-tdep.c:1658: ((unsigned long long) sizeof (nop_insn)), fprintf_unfiltered doesn't support z (or j for that matter), and fixing that is a larger patch than I'd like to write, so this does basically what the ARI warnings recommends. We don't need the cast as there is a prototype for plongest. * riscv-tdep.c (riscv_push_dummy_code): Change %lld to %s and use plongest instead of unsigned long long cast. --- gdb/riscv-tdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index e4a66f1429..003b230fcf 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -1654,8 +1654,8 @@ riscv_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, if (riscv_debug_breakpoints || riscv_debug_infcall) fprintf_unfiltered (gdb_stdlog, - "Writing %lld-byte nop instruction to %s: %s\n", - ((unsigned long long) sizeof (nop_insn)), + "Writing %s-byte nop instruction to %s: %s\n", + plongest (sizeof (nop_insn)), paddress (gdbarch, *bp_addr), (status == 0 ? "success" : "failed"));