From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id nY0CDpOZkGANUgAAWB0awg (envelope-from ) for ; Mon, 03 May 2021 20:47:15 -0400 Received: by simark.ca (Postfix, from userid 112) id 2D10B1F11C; Mon, 3 May 2021 20:47:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 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 4BEB91E813 for ; Mon, 3 May 2021 20:47:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D2027393C03B; Tue, 4 May 2021 00:47:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D2027393C03B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620089233; bh=4Iyz2BiKBEy3/Tb0NngrnKjpwFaQT0Xu+bTPzLEQPjM=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=B5jpNkt0e4poEVIIluEo9tfEQjnaH7cvNh1Tmlx45P8si1GKQCfuymJsnmSWBqTbt /s/pZT2IkBmKWn0256yCXKWokaICt3RhuA7BBwji0fHAqWKOmsv+7w2HHsjiWwdUCJ wpUVQkXbVciOPAru/Nw4Yt/vd4K+W9ysVxbtak9E= Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 5B979385783D for ; Tue, 4 May 2021 00:47:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5B979385783D Received: from vapier (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 294B5340931; Tue, 4 May 2021 00:47:10 +0000 (UTC) Date: Mon, 3 May 2021 20:47:09 -0400 To: Christian Biesinger Subject: Re: [PATCH/committed] sim: rx: cast bfd_vma when printing Message-ID: Mail-Followup-To: Christian Biesinger , gdb-patches References: <20210501202929.29766-1-vapier@gentoo.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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: Mike Frysinger via Gdb-patches Reply-To: Mike Frysinger Cc: gdb-patches Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" On 03 May 2021 16:47, Christian Biesinger via Gdb-patches wrote: > On Mon, May 3, 2021 at 3:57 PM Mike Frysinger wrote: > > On 03 May 2021 11:20, Christian Biesinger wrote: > > > On Sat, May 1, 2021, 15:29 Mike Frysinger wrote: > > > > A bit of a hack, but it's what we've been doing so far when printing > > > > bfd_vma's since bfd doesn't provide PRI helper types for us to use. > > > > > > > > --- a/sim/rx/load.c > > > > +++ b/sim/rx/load.c > > > > @@ -151,7 +151,7 @@ rx_load (bfd *prog, host_callback *callback) > > > > } > > > > if (bfd_bread (buf, size, prog) != size) > > > > { > > > > - fprintf (stderr, "Failed to read %lx bytes\n", size); > > > > + fprintf (stderr, "Failed to read %lx bytes\n", (long) size); > > > > > > Wouldn't it be better to use "long long", especially for mingw? > > > > not sure why mingw is special here. but let's ignore that. > > mingw (and msvc) is special because sizeof(long) is 4, even on a 64-bit system. > https://stackoverflow.com/questions/22344388/size-of-long-int-and-int-in-c-showing-4-bytes we have ILP32 models on mips/n32 [2000], x86_64/x32 [2011], and aarch64 [2016], so i don't think mingw does anything that unique anymore. we've long known that long is inappropriate for things that could be 64-bit. the trouble is when we half implement the suite like just coming up with a typedef and skimping on printf formats :(. -mike