Date: Mon, 13 Apr 2015 11:49:37 +0100 From: Andrew Turner <andrew@fubar.geek.nz> To: Bruce Evans <brde@optusnet.com.au> Cc: Andrew Turner <andrew@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org 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>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 9 Apr 2015 21:38:02 +1000 (EST) Bruce Evans <brde@optusnet.com.au> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150413114937.469db8ce>