Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Jul 2017 20:27:19 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r321305 - head/sys/boot/efi/boot1
Message-ID:  <201707202027.v6KKRJBR014764@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Thu Jul 20 20:27:19 2017
New Revision: 321305
URL: https://svnweb.freebsd.org/changeset/base/321305

Log:
  Fix printf format warning in zfs_module.c
  
  Clang 5.0.0 got better warnings about print format strings using %zd,
  and this leads to the following -Werror warning on e.g. arm:
  
      sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                          "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                                     ^~~~~~~~~~
  
  Fix this by casting off_t arguments to intmax_t, and using %jd instead.
  
  Reviewed by:	tsoome
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D11678

Modified:
  head/sys/boot/efi/boot1/zfs_module.c

Modified: head/sys/boot/efi/boot1/zfs_module.c
==============================================================================
--- head/sys/boot/efi/boot1/zfs_module.c	Thu Jul 20 20:16:18 2017	(r321304)
+++ head/sys/boot/efi/boot1/zfs_module.c	Thu Jul 20 20:27:19 2017	(r321305)
@@ -182,8 +182,8 @@ load(const char *filepath, dev_info_t *devinfo, void *
 
 	if ((status = bs->AllocatePool(EfiLoaderData, (UINTN)st.st_size, &buf))
 	    != EFI_SUCCESS) {
-		printf("Failed to allocate load buffer %zd for pool '%s' for '%s' "
-		    "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
+		printf("Failed to allocate load buffer %jd for pool '%s' for '%s' "
+		    "(%lu)\n", (intmax_t)st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
 		return (EFI_INVALID_PARAMETER);
 	}
 



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