From owner-svn-src-head@FreeBSD.ORG Mon Apr 13 10:49:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04502D32; Mon, 13 Apr 2015 10:49:47 +0000 (UTC) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id C15B03E1; Mon, 13 Apr 2015 10:49:46 +0000 (UTC) Received: from bender (host86-166-43-191.range86-166.btcentralplus.com [86.166.43.191]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id A02E2D79EC; Mon, 13 Apr 2015 10:49:38 +0000 (UTC) Date: Mon, 13 Apr 2015 11:49:37 +0100 From: Andrew Turner To: Bruce Evans Subject: Re: svn commit: r281307 - head/sys/boot/efi/boot1 Message-ID: <20150413114937.469db8ce@bender> In-Reply-To: <20150409212938.T3716@besplex.bde.org> References: <201504091015.t39AFlkh016216@svn.freebsd.org> <20150409212938.T3716@besplex.bde.org> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.27; amd64-portbld-freebsd10.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2015 10:49:47 -0000 On Thu, 9 Apr 2015 21:38:02 +1000 (EST) Bruce Evans wrote: > On Thu, 9 Apr 2015, Andrew Turner wrote: > > > Log: > > Print error values with hex to make it easier to find the EFI > > error type. > > > > Modified: > > head/sys/boot/efi/boot1/boot1.c > > > > Modified: head/sys/boot/efi/boot1/boot1.c > > ============================================================================== > > --- head/sys/boot/efi/boot1/boot1.c Thu Apr 9 10:12:58 > > 2015 (r281306) +++ head/sys/boot/efi/boot1/boot1.c > > Thu Apr 9 10:15:47 2015 (r281307) @@ -330,18 +330,18 @@ > > load(const char *fname) status = > > systab->BootServices->LoadImage(TRUE, image, bootdevpath, buffer, > > bufsize, &loaderhandle); if (EFI_ERROR(status)) > > - printf("LoadImage failed with error %d\n", status); > > + printf("LoadImage failed with error %lx\n", > > status); > > How would anyone guess that a number like "10" is in hex? > > Hex numbers should usually be printed using "%#..." format. If the > boot loader doesn't have that, then use an 0x prefix. > > This shouldn't compile. 'status' cannot have type int and type > unsigned long at the same time. clang warns even without -Wformat in > CFLAGS. It is either uint32_t on 32-bit architectures, or uint64_t on 64-bit architectures. I know it's wrong on 32-bit, however on both architectures we use this code a long is 32-bit. Andrew