Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 9 Apr 2015 21:38:02 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Andrew Turner <andrew@freebsd.org>
Cc:        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:  <20150409212938.T3716@besplex.bde.org>
In-Reply-To: <201504091015.t39AFlkh016216@svn.freebsd.org>
References:  <201504091015.t39AFlkh016216@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150409212938.T3716>