Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread David Wolfskill
On Sat, Apr 18, 2015 at 11:36:05PM +0800, Marcelo Araujo wrote:
 Hi,
 
 Saw your patch, why %ju and not %llx as the output shows?

%llx fails amd64, as the object is 64 bits, and therefore merely long,
not long long in amd64.

I will test kib@'s recommendation (casting)  report.

...

Peace,
david
-- 
David H. Wolfskill  da...@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.


pgpj7jH78wB2_.pgp
Description: PGP signature


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread Konstantin Belousov
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. Wolfskillda...@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 ?


___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Fix for r281680 -- broke i386 world

2015-04-18 Thread David Wolfskill
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  da...@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;
 }


pgpX67JRiy9Zl.pgp
Description: PGP signature


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread Marcelo Araujo
Hi,

Saw your patch, why %ju and not %llx as the output shows?

Best,
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  da...@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.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread Marcelo Araujo
I didn't catch it. But please unbroken the I386 build.
On Apr 18, 2015 11:17 PM, David Wolfskill da...@catwhisker.org 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  da...@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.

___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread Steven Hartland



On 18/04/2015 17:30, 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.)

The errors not very good, but I'm guessing your missing #include 
stdint.h for uintmax_t where as u_int64_t is from sys/types.h iirc.


Regards
Steve
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread David Wolfskill
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  da...@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;
 }


pgpuZQrp5e92p.pgp
Description: PGP signature


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread Konstantin Belousov
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. Wolfskillda...@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.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread David Wolfskill
On Sat, Apr 18, 2015 at 07:46:40PM +0300, Konstantin Belousov wrote:
 ...
 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.

OK; attached survived buildworld for both amd64  i386, and I think it's
what's intended.

On Sat, Apr 18, 2015 at 06:03:42PM +0100, Steven Hartland wrote:
 ... 
  So I took a bit of evasive action.)
 
 The errors not very good, but I'm guessing your missing #include 
 stdint.h for uintmax_t where as u_int64_t is from sys/types.h iirc.
 ...

Quite so; thanks.

Peace,
david
-- 
David H. Wolfskill  da...@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)
@@ -39,6 +39,7 @@
 #include errno.h
 #include netgraph/ng_message.h
 #include errno.h
+#include stdint.h
 #include stdio.h
 #include stdlib.h
 #include string.h
@@ -232,8 +233,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,
+			(uintmax_t)rp.le_features);
 
 	return 0;
 }
@@ -250,7 +251,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, (uintmax_t)rp.le_status);
 
 	return 0;
 }


pgpYpfhdVV_jE.pgp
Description: PGP signature


Re: Fix for r281680 -- broke i386 world

2015-04-18 Thread Konstantin Belousov
On Sat, Apr 18, 2015 at 10:53:10AM -0700, David Wolfskill wrote:
 On Sat, Apr 18, 2015 at 07:46:40PM +0300, Konstantin Belousov wrote:
  ...
  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.
 
 OK; attached survived buildworld for both amd64  i386, and I think it's
 what's intended.
 
 On Sat, Apr 18, 2015 at 06:03:42PM +0100, Steven Hartland wrote:
  ... 
   So I took a bit of evasive action.)
  
  The errors not very good, but I'm guessing your missing #include 
  stdint.h for uintmax_t where as u_int64_t is from sys/types.h iirc.
  ...
 
 Quite so; thanks.
 
 Peace,
 david
 -- 
 David H. Wolfskillda...@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)
 @@ -39,6 +39,7 @@
  #include errno.h
  #include netgraph/ng_message.h
  #include errno.h
 +#include stdint.h
  #include stdio.h
  #include stdlib.h
  #include string.h
 @@ -232,8 +233,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,
 + (uintmax_t)rp.le_features);
  
   return 0;
  }
 @@ -250,7 +251,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, (uintmax_t)rp.le_status);
  
   return 0;
  }


Yes, thank you.  This is exactly what I run with make universe right now.
It seems the patch was landed in r281697.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org