[patch] fix i386 compile with -WError

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Jul 17 13:20:53 UTC 2015


On Fri, Jul 17, 2015 at 06:19:07PM +1200, Douglas Bagnall wrote:
> This I think is the last one.
> 
> Now I'm trying to get Samba to actually pass tests on the i386, which is
> proving a bit harder. I'm having particular trouble with everything that
> uses ad_dc_ntvfs. There are also upstream (and/or VM) bugs like
> https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/1471029 that don't
> help. It is almost as if i386 has been silently and universally abandoned.
> 
> cheers,
> Douglas

> >From 783a02f44b344e2523f7bad8d54fef80f1bd121a Mon Sep 17 00:00:00 2001
> From: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
> Date: Wed, 1 Jul 2015 10:41:34 +1200
> Subject: [PATCH 2/4] Use intptr_t for pointer int cast in SMBC_getdents_ctx()
> 
> On i386, unsigned long long is 64 bit while the pointer is 32, and
> this fails under autobuild with -WError.
> 
> Signed-off-by: Douglas Bagnall <douglas.bagnall at catalyst.net.nz>
> ---
>  source3/libsmb/libsmb_dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
> index 636e0cc..5f8b0aa 100644
> --- a/source3/libsmb/libsmb_dir.c
> +++ b/source3/libsmb/libsmb_dir.c
> @@ -1129,7 +1129,7 @@ SMBC_getdents_ctx(SMBCCTX *context,
>  
>  		/* Try and align the struct for the next entry
>  		   on a valid pointer boundary by appending zeros */
> -		while((rem > 0) && ((unsigned long long)ndir & (sizeof(void*) - 1))) {
> +		while((rem > 0) && ((intptr_t)ndir & (sizeof(void*) - 1))) {

Don't you want a uintptr_t here instead of an intptr_t?

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list