On Mon, Aug 07, 2017 at 11:53:13AM +0200, Mark Kettenis wrote:
> Or as pirofti@ suggests, simply droppy the 'h' modifier altogether is
> safe as well as u_char gets promoted to int in a varargs function.
> And clang doesn't want about this one.
> 
> Any preference?

When I encountered this problem years ago, consensus was not to use
h in kernel.

OK bluhm@

> Index: kern/subr_disk.c
> ===================================================================
> RCS file: /cvs/src/sys/kern/subr_disk.c,v
> retrieving revision 1.231
> diff -u -p -r1.231 subr_disk.c
> --- kern/subr_disk.c  6 Aug 2017 19:56:29 -0000       1.231
> +++ kern/subr_disk.c  7 Aug 2017 09:50:43 -0000
> @@ -1864,7 +1864,7 @@ duid_format(u_char *duid)
>       static char duid_str[17];
>  
>       snprintf(duid_str, sizeof(duid_str),
> -         "%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx",
> +         "%02x%02x%02x%02x%02x%02x%02x%02x",
>           duid[0], duid[1], duid[2], duid[3],
>           duid[4], duid[5], duid[6], duid[7]);
>  

Reply via email to