lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a05374d3-401f-bec3-03f4-45d4072d43f4@gmx.com>
Date:   Thu, 7 Dec 2017 08:32:04 +0800
From:   Qu Wenruo <quwenruo.btrfs@....com>
To:     Arnd Bergmann <arnd@...db.de>, Chris Mason <clm@...com>,
        Josef Bacik <jbacik@...com>, David Sterba <dsterba@...e.com>
Cc:     Qu Wenruo <wqu@...e.com>, Su Yue <suy.fnst@...fujitsu.com>,
        Nikolay Borisov <nborisov@...e.com>,
        linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] btrfs: tree-checker: use %zu format string for size_t



On 2017年12月06日 22:18, Arnd Bergmann wrote:
> The return value of sizeof() is of type size_t, so we must print it
> using the %z format modifier rather than %l to avoid this warning
> on some architectures:
> 
> fs/btrfs/tree-checker.c: In function 'check_dir_item':
> fs/btrfs/tree-checker.c:273:50: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'u32' {aka 'unsigned int'} [-Werror=format=]

Any idea about which architecture will cause such warning?
On x86_64 I always fail to get such warning.

> 
> Fixes: 005887f2e3e0 ("btrfs: tree-checker: Add checker for dir item")

Reviewed-by: Qu Wenruo <wqu@...e.com>

Thanks,
Qu

> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  fs/btrfs/tree-checker.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
> index 66dac0a4b01f..7c55e3ba5a6c 100644
> --- a/fs/btrfs/tree-checker.c
> +++ b/fs/btrfs/tree-checker.c
> @@ -270,7 +270,7 @@ static int check_dir_item(struct btrfs_root *root,
>  		/* header itself should not cross item boundary */
>  		if (cur + sizeof(*di) > item_size) {
>  			dir_item_err(root, leaf, slot,
> -		"dir item header crosses item boundary, have %lu boundary %u",
> +		"dir item header crosses item boundary, have %zu boundary %u",
>  				cur + sizeof(*di), item_size);
>  			return -EUCLEAN;
>  		}
> 



Download attachment "signature.asc" of type "application/pgp-signature" (521 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ