From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lGSGp-0000Dk-NC for mharc-grub-devel@gnu.org; Sun, 28 Feb 2021 15:02:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:32886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGSGo-0000Dd-TZ for grub-devel@gnu.org; Sun, 28 Feb 2021 15:02:26 -0500 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:40704) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lGSGm-0000QQ-RS for grub-devel@gnu.org; Sun, 28 Feb 2021 15:02:26 -0500 Received: by mail-ot1-x332.google.com with SMTP id b8so14406225oti.7 for ; Sun, 28 Feb 2021 12:02:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=efficientek-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=os5MEBw34GU2P7buejAvfxj8Iw669uKzydPmahT6Rn4=; b=q2Kk62B2wz2NbuioG46b3TjhYg41urJYX2li/QWiJYEMrBm/4RCmOiSitKAuRzMnJp TnlYxlIy9RA/+RDmo1AlLgE9bI83vhCgS2X3j1QR0QZ3Fne1E+/EJVXoadza3ZiaPiBv I62oS//F1jKjT712Ab8vCJMAp7oK4Ywq42KxhX3y+j7v10wU4bURgkeGDK9V4JRlTpSf WuMc80KSY6JErFVYspvjwDeahWJumzC9k4h8I58Lr+gxXYgv2zvBlxmWAsMi0G8lBLIw hw8T8sXxpYgfNJMT61bM/+BaDZT8NAVTYkImB0PrDpQdJwGsv08NhvxQC57oecmG61kl Ls2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=os5MEBw34GU2P7buejAvfxj8Iw669uKzydPmahT6Rn4=; b=sjjONZETsngLyBX9hE/eN9D/FQNmwzpmcZWwaWgOyGc2+GOgi4pPYDWepai+yyZhj0 A3r1l+K7OsDSeUta0YFKHSi3Cr4gBOD056KxV6N35PBmjtwkMAuuU2pz0bClEbuXSpyJ VjWYLy2OzrfceDDsf5usmUOqTAJa1/i4ctZrnqG3zf5kbDENFxh6MKJtbwMPtlTTq/uc QNhG/UyEzltq0ZZ3I9EpWyxsNUF97u36WO4N/EyhCT6Bll4l8PpVPvrxailVRpTI1Vpa wCYGJz6sL3FAaWrlojCoYsEceDcUpL+TzbEu5CEy8BklksjHCDTkZGlRCWoG5gEXtUvH ZvvA== X-Gm-Message-State: AOAM531PwhDd+mbEfgn97bqndxbaTWY3ryrtoFGurH6GwmObizuGROlS sJRSUMPcLh0n/GFqqr3vA9Ls/Q== X-Google-Smtp-Source: ABdhPJxSIU9/b85d97gdLzMojLFyPMYFGCzXAoHPg4QADAv5iO+qW0JZ4orXItVr5YV50VNUX+RNiA== X-Received: by 2002:a05:6830:1342:: with SMTP id r2mr10536401otq.2.1614542542626; Sun, 28 Feb 2021 12:02:22 -0800 (PST) Received: from crass-HP-ZBook-15-G2 (47-218-208-29.bcstcmtk03.res.dyn.suddenlink.net. [47.218.208.29]) by smtp.gmail.com with ESMTPSA id e72sm3294935ote.26.2021.02.28.12.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Feb 2021 12:02:22 -0800 (PST) Date: Sun, 28 Feb 2021 14:02:20 -0600 From: Glenn Washburn To: Daniel Kiper Cc: grub-devel@gnu.org Subject: Re: [PATCH v4 08/13] error: Use %p format code for pointer types Message-ID: <20210228140220.53ee3c58@crass-HP-ZBook-15-G2> In-Reply-To: <20210227114306.2zalwbxtpjiahvkm@tomti.i.net-space.pl> References: <83e0cdcfa4280ccd65ed420f4512edf290e35aaa.1613700218.git.development@efficientek.com> <20210227114306.2zalwbxtpjiahvkm@tomti.i.net-space.pl> Reply-To: development@efficientek.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::332; envelope-from=development@efficientek.com; helo=mail-ot1-x332.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Feb 2021 20:02:27 -0000 On Sat, 27 Feb 2021 12:43:06 +0100 Daniel Kiper wrote: > On Thu, Feb 18, 2021 at 08:47:09PM -0600, Glenn Washburn wrote: > > Signed-off-by: Glenn Washburn > > --- > > grub-core/loader/i386/pc/linux.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/grub-core/loader/i386/pc/linux.c > > b/grub-core/loader/i386/pc/linux.c index 814988ab9..0bc5d6807 100644 > > --- a/grub-core/loader/i386/pc/linux.c > > +++ b/grub-core/loader/i386/pc/linux.c > > @@ -230,9 +230,9 @@ grub_cmd_linux (grub_command_t cmd > > __attribute__ ((unused)), && GRUB_LINUX_ZIMAGE_ADDR + > > grub_linux16_prot_size > > > grub_linux_real_target) > > { > > - grub_error (GRUB_ERR_BAD_OS, "too big zImage (0x%x > 0x%x), > > use bzImage instead", > > + grub_error (GRUB_ERR_BAD_OS, "too big zImage (%p > %p), use > > bzImage instead", (char *) GRUB_LINUX_ZIMAGE_ADDR + > > grub_linux16_prot_size, > > - (grub_size_t) grub_linux_real_target); > > + (void *) grub_linux_real_target); > > I would use PRIxGRUB_SIZE and PRIxGRUB_ADDR respectively. IIRC, The reason I chose the %p format string was because the compiler considers it an error to use a pointer for an integer format string code. Does it make more sense to have both be PRIxGRUB_ADDR and for PRIxGRUB_ADDR to be defined as "p"? Since they are both pointers, I'm not following why the code should be semantically different (ie PRIxGRUB_SIZE and PRIxGRUB_ADDR, instead of just one of those). If you do want to use a "*x" format code, I think we'd need to cast those arguments. Glenn