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

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Apr 18, 2015 at 08:17:02AM -0700, David Wolfskill wrote:
> Head/amd64 @ r281689 built OK, but my i386 build failed:
> 
> ...
> --- usr.sbin.all__D ---
> --- all_subdir_bluetooth ---
> /usr/src/usr.sbin/bluetooth/hccontrol/le.c:236:4: error: format specifies type 'unsigned long' but the argument has type 'u_int64_t' (aka 'unsigned long long') [-Werror,-Wformat]
>                         rp.le_features);
>                         ^~~~~~~~~~~~~~
> /usr/src/usr.sbin/bluetooth/hccontrol/le.c:253:49: error: format specifies type 'unsigned long' but the argument has type 'u_int64_t' (aka 'unsigned long long') [-Werror,-Wformat]
>         printf("LE_STATUS: %d %d %lx\n", e, rp.status, rp.le_status);
>                                  ~~~                   ^~~~~~~~~~~~
>                                  %llx
> 2 errors generated.
> ....
> 
> 
> The attached patch allows i386 to build, and I then tested to verify
> that amd64 still built.  (I don't have Bluetooth devices, so I
> cannot test its operation.)
> 
> 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,7 +232,7 @@
>  			NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), 
>  			(void *)&rp, &n);
>  
> -	printf("LOCAL SUPPORTED: %d %d %lu\n", e, rp.status,
> +	printf("LOCAL SUPPORTED: %d %d %ju\n", e, rp.status,
>  			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, 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 ?





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