Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 2015 19:46:40 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        David Wolfskill <david@catwhisker.org>
Cc:        current@freebsd.org, Takanori Watanabe <takawata@FreeBSD.org>
Subject:   Re: Fix for r281680 -- broke i386 world
Message-ID:  <20150418164640.GY2390@kib.kiev.ua>
In-Reply-To: <20150418163057.GD36163@albert.catwhisker.org>
References:  <20150418151702.GB36163@albert.catwhisker.org> <20150418153459.GX2390@kib.kiev.ua> <20150418163057.GD36163@albert.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 18, 2015 at 09:30:57AM -0700, David Wolfskill wrote:
> On Sat, Apr 18, 2015 at 06:34:59PM +0300, Konstantin Belousov wrote:
> > ...
> > > -	printf("LE_STATUS: %d %d %lx\n", e, rp.status, rp.le_status);
> > > +	printf("LE_STATUS: %d %d %jx\n", e, rp.status, rp.le_status);
> > >  
> > >  	return 0;
> > >  }
> > 
> > The j modificator specifies that the type of the argument is (u)intmax_t.
> > It is only a coincidense that uint64_t is max integer type, the arg should
> > be casted to uintmax_t.
> > 
> > Could you, please, update and test ?
> > ....
> 
> Thank you for the correction; the attached patch survives both i386 &
> amd64 "make buildworld" ... and comes a bit closer to the above
> specification.  (I had tried "(uintmax_t)rp.le_features" at first; that
> failed (at least on amd64), with:
> 
> --- usr.sbin.all__D ---
> /usr/src/usr.sbin/bluetooth/hccontrol/le.c:236:15: error: expected ')'
>                         (uintmax_t)rp.le_features);
>                                    ^
> /usr/src/usr.sbin/bluetooth/hccontrol/le.c:235:8: note: to match this '('
>         printf("LOCAL SUPPORTED: %d %d %ju\n", e, rp.status,
>               ^
> /usr/src/usr.sbin/bluetooth/hccontrol/le.c:253:60: error: expected ')'
>         printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status);
>                                                                   ^
> /usr/src/usr.sbin/bluetooth/hccontrol/le.c:253:8: note: to match this '('
>         printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status);
>               ^
> 2 errors generated.
> 
> So I took a bit of evasive action.)
> 
> Peace,
> david
> -- 
> David H. Wolfskill				david@catwhisker.org
> Those who murder in the name of God or prophet are blasphemous cowards.
> 
> See http://www.catwhisker.org/~david/publickey.gpg for my public key.

> Index: usr.sbin/bluetooth/hccontrol/le.c
> ===================================================================
> --- usr.sbin/bluetooth/hccontrol/le.c	(revision 281689)
> +++ usr.sbin/bluetooth/hccontrol/le.c	(working copy)
> @@ -232,8 +232,8 @@
>  			NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), 
>  			(void *)&rp, &n);
>  
> -	printf("LOCAL SUPPORTED: %d %d %lu\n", e, rp.status,
> -			rp.le_features);
> +	printf("LOCAL SUPPORTED: %d %d %ju\n", e, rp.status,
> +			(u_int64_t)rp.le_features);
>  
>  	return 0;
>  }
> @@ -250,7 +250,7 @@
>  					NG_HCI_OCF_LE_READ_SUPPORTED_STATUS),
>  			       		(void *)&rp, &n);
>  
> -	printf("LE_STATUS: %d %d %lx\n", e, rp.status, rp.le_status);
> +	printf("LE_STATUS: %d %d %jx\n", e, rp.status, (u_int64_t)rp.le_status);
>  
>  	return 0;
>  }

No, this is equally wrong.  If the problem is due to uintmax_t not brought
in to the scope by other dependencies, explicit
#include <stdint.h>
should be added at the prologue.

I am struggling for two days trying to pass my pending patches through
make tinderbox.  I added the uintmax_t version into the mix right now
for the next try.



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