Message ID | 20241122163701.31772-1-tdevries@suse.de |
---|---|
State | New |
Headers |
Return-Path: <binutils-bounces~patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 496313857025 for <patchwork@sourceware.org>; Fri, 22 Nov 2024 16:37:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 496313857025 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bzW2PXdB; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=bOY5fW5i; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=bzW2PXdB; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=bOY5fW5i X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id C2862385AC2D for <binutils@sourceware.org>; Fri, 22 Nov 2024 16:36:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C2862385AC2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C2862385AC2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732293376; cv=none; b=s9xlqepa5nvQRHBRSlrORr/WSpGydIcjww/uZpwNtfPS3Q1LGT3rfJkCxxH+FL/Bl3K3CToHXieABsvrOuIdOHE7HYfZ48d6JFh8edeqc635yLBnMpDlvdkVREB9ynsc/CB0kuRAFeXs2HWzmCiOBfFQvJQLh6CBlHN3gFIiKpk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1732293376; c=relaxed/simple; bh=GEi1WL/LjOno+9BamabYcd49RHXfZF+OcaYoPLAyzUk=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=ucex8JNZgRRVO1MR88g5kCn6Q28nbgLQl6yCnP4f9OSzjgLmWWtJjs+tNL6f54JVSgdxU2sBKHN34MH8zTirwaJVnvzgF3dWMpeaVvnpnyxgPP0mpwH+vmRifnzBBuSkIUSOc/bX2NqnvCO5zhhi25KSQhPF30w4n7/GzmTFAYc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2862385AC2D Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 5CEEE21176 for <binutils@sourceware.org>; Fri, 22 Nov 2024 16:36:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732293374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ij9wpEhK9eMhwZs5VIxaU5N4lJs8OiuxhGGKI7JfCjg=; b=bzW2PXdBhmvs44697Fuy3sgHevd4G8i7pSk04mAlRtpcaPPDCYmYWhWmtqzRjlKYP+YPbS HUoyXLaL7cxbJVYl05WL2SK24y4FyLmjraY0Ne12k3ur9afeSDYRCKqeXY8cIzPoAegPR0 sw2qoa8reZB4OcbbPF64K6Kr9VbYuNE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732293374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ij9wpEhK9eMhwZs5VIxaU5N4lJs8OiuxhGGKI7JfCjg=; b=bOY5fW5iy/SVNGcx4MGnHu+7ajx5/HirJUxrbfqhNqLDPA1xORsnp9U3Xj6nlTQo1oIbC1 ZjbsReXdxetfgiBA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732293374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ij9wpEhK9eMhwZs5VIxaU5N4lJs8OiuxhGGKI7JfCjg=; b=bzW2PXdBhmvs44697Fuy3sgHevd4G8i7pSk04mAlRtpcaPPDCYmYWhWmtqzRjlKYP+YPbS HUoyXLaL7cxbJVYl05WL2SK24y4FyLmjraY0Ne12k3ur9afeSDYRCKqeXY8cIzPoAegPR0 sw2qoa8reZB4OcbbPF64K6Kr9VbYuNE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732293374; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ij9wpEhK9eMhwZs5VIxaU5N4lJs8OiuxhGGKI7JfCjg=; b=bOY5fW5iy/SVNGcx4MGnHu+7ajx5/HirJUxrbfqhNqLDPA1xORsnp9U3Xj6nlTQo1oIbC1 ZjbsReXdxetfgiBA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4400B138A7 for <binutils@sourceware.org>; Fri, 22 Nov 2024 16:36:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id R9csD/6yQGcwEQAAD6G6ig (envelope-from <tdevries@suse.de>) for <binutils@sourceware.org>; Fri, 22 Nov 2024 16:36:14 +0000 From: Tom de Vries <tdevries@suse.de> To: binutils@sourceware.org Subject: [PATCH] opcodes: fix Werror=format build breaker in opcodes/riscv-dis.c Date: Fri, 22 Nov 2024 17:37:01 +0100 Message-Id: <20241122163701.31772-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-0.999]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; URIBL_BLOCKED(0.00)[imap1.dmz-prg2.suse.org:helo,suse.de:mid]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; PREVIOUSLY_DELIVERED(0.00)[binutils@sourceware.org]; TO_DN_NONE(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid] X-Spam-Score: -3.30 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list <binutils.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/binutils>, <mailto:binutils-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/binutils/> List-Post: <mailto:binutils@sourceware.org> List-Help: <mailto:binutils-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/binutils>, <mailto:binutils-request@sourceware.org?subject=subscribe> Errors-To: binutils-bounces~patchwork=sourceware.org@sourceware.org |
Series |
opcodes: fix Werror=format build breaker in opcodes/riscv-dis.c
|
|
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_binutils_build--master-arm | success | Build passed |
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 | success | Build passed |
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 | success | Test passed |
linaro-tcwg-bot/tcwg_binutils_check--master-arm | success | Test passed |
Commit Message
Tom de Vries
Nov. 22, 2024, 4:37 p.m. UTC
I build gdb on arm-linux and ran into: ... CC riscv-dis.lo opcodes/riscv-dis.c: In function ‘print_insn_args’: opcodes/riscv-dis.c:743:29: error: format ‘%lu’ expects argument of type \ ‘long unsigned int’, but argument 4 has type ‘insn_t’ \ {aka ‘long long unsigned int’} [-Werror=format=] 743 | "%lu", EXTRACT_ZCMT_INDEX (l)); | ~~^ | | | long unsigned int | %llu ... Fix this by printing the insn_t value, which is a uint64_t, using PRIu64. Tested by finishing the build. --- opcodes/riscv-dis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) base-commit: 8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c
Comments
Thanks, looks good to me. Nelson On Sat, Nov 23, 2024 at 12:38 AM Tom de Vries <tdevries@suse.de> wrote: > I build gdb on arm-linux and ran into: > ... > CC riscv-dis.lo > opcodes/riscv-dis.c: In function ‘print_insn_args’: > opcodes/riscv-dis.c:743:29: error: format ‘%lu’ expects argument of type \ > ‘long unsigned int’, but argument 4 has type ‘insn_t’ \ > {aka ‘long long unsigned int’} [-Werror=format=] > 743 | "%lu", EXTRACT_ZCMT_INDEX (l)); > | ~~^ > | | > | long unsigned int > | %llu > ... > > Fix this by printing the insn_t value, which is a uint64_t, using PRIu64. > > Tested by finishing the build. > --- > opcodes/riscv-dis.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c > index 101380f93aa..c1212b14a05 100644 > --- a/opcodes/riscv-dis.c > +++ b/opcodes/riscv-dis.c > @@ -740,7 +740,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma > pc, disassemble_info *info > case 'i': > case 'I': > print (info->stream, dis_style_address_offset, > - "%lu", EXTRACT_ZCMT_INDEX (l)); > + "%" PRIu64, EXTRACT_ZCMT_INDEX (l)); > break; > default: > goto undefined_modifier; > > base-commit: 8a7f13063a6d5314cfde5b4f1dc49afa2922cf8c > -- > 2.35.3 > >
diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index 101380f93aa..c1212b14a05 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -740,7 +740,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info case 'i': case 'I': print (info->stream, dis_style_address_offset, - "%lu", EXTRACT_ZCMT_INDEX (l)); + "%" PRIu64, EXTRACT_ZCMT_INDEX (l)); break; default: goto undefined_modifier;