Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp98645imb; Thu, 28 Feb 2019 17:19:11 -0800 (PST) X-Google-Smtp-Source: APXvYqzlVaMkL5tJcphAmmqzUPHHNwINP2hKk2WYo7TaFcgrSzhNQ6S47fvCZYG5jr1Wxcl3VHAl X-Received: by 2002:a17:902:33c1:: with SMTP id b59mr2554279plc.220.1551403151215; Thu, 28 Feb 2019 17:19:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551403151; cv=none; d=google.com; s=arc-20160816; b=KrEhDUPzoo9SfdGhmyB7NfQdgkCP3snBWmm68teorsE/ESa/aEV1HL8/yWniX5/am1 7Qh+TmdExn/VvUwu5M/lzYj2oTIFuFdR8iBnYdbsR/SXCUCgO+2Cc9F9ARIeQrmiytgq NZUbx34sSbiSOsZa4dGPPnzNeQpJH/aQJ/UzKvmNhtU0FLUhAAtPiIClY3rfMeaMRv1X AT4p6+5WQsz0H/75vxt53jqUtHy846/pwBd82PJSgmndcksjeGDgwKEsk5JcnwBF8AkX MniTEStlQGPQo+xMuBeC7m9DD1Pw6nxlZ0hc16K2uzGBUV1AKavee5P1mouXSEXF5Xbs tBhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=oAxiPLBdip4HdEj8Znmxhn/27gc/9LEU8cILYUf/zWI=; b=BkvHJb2dVkQwM8JNLK44O3x6Hhz2FNgdWJCaNsebJt7YjJctJwyxbZGxpMKldyv54X 4bh4ZVAhRnGoiess1i83+Ub0dV2Bc+H07VAGIWvtEw2xn7cO8Yd65wBLKJcIgc4EyIhM FnF5GldRCWZLKJjOcKw9/92fc4uBsdeOPOz4Y+LEe1kWSk4nXBcv16AYftCUb00Wr4Yc C5Eum487qHvdZ+HelfOLMLD4T8IBPVd9OL7G4BVyxPgSS58QZz5HyH5kr48068HUSIqs 0BAP+sPzF1HC6TEDtdaaZ7SKPiLzieeh88KaQSBT/WrsTYZxvb4fFfeKgbRsH3hEE3B1 1y1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w2si19340627pgm.456.2019.02.28.17.18.13; Thu, 28 Feb 2019 17:19:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732609AbfB1XFi (ORCPT + 99 others); Thu, 28 Feb 2019 18:05:38 -0500 Received: from smtprelay0205.hostedemail.com ([216.40.44.205]:56831 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727945AbfB1XFi (ORCPT ); Thu, 28 Feb 2019 18:05:38 -0500 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id 993CA6D86; Thu, 28 Feb 2019 23:05:36 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2110:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3865:3867:3868:3871:3872:3874:4321:5007:6119:7557:7903:10004:10400:10848:11232:11658:11914:12043:12740:12760:12895:13069:13095:13311:13357:13439:14096:14097:14181:14659:14721:21080:21433:21451:21611:21627:30054:30060:30070:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:29,LUA_SUMMARY:none X-HE-Tag: pies40_13b1a53101c42 X-Filterd-Recvd-Size: 2396 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf20.hostedemail.com (Postfix) with ESMTPA; Thu, 28 Feb 2019 23:05:35 +0000 (UTC) Message-ID: <1450785b937f4a2b5f98c8548986b162684a719b.camel@perches.com> Subject: Re: [PATCH v2] wusb: use correct format characters From: Joe Perches To: Jon Flatley Cc: Louis Taylor , gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, Linux Kernel Mailing List , clang-built-linux@googlegroups.com, Nick Desaulniers Date: Thu, 28 Feb 2019 15:05:34 -0800 In-Reply-To: References: <20190228115256.5446-1-louis@kragniz.eu> <20190228122417.9318-1-louis@kragniz.eu> <15c6689389503a82394bccb9204650bf20a7a6d3.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2019-02-28 at 14:23 -0800, Jon Flatley wrote: > Thanks for the patch and comments. > > On Thu, Feb 28, 2019 at 1:53 PM Joe Perches wrote: > > On Thu, 2019-02-28 at 12:24 +0000, Louis Taylor wrote: > > > When compiling with -Wformat, clang warns: > > > ./include/linux/usb/wusb.h:245:5: warning: format specifies type > > > 'unsigned short' but the argument has type 'u8' (aka 'unsigned char') > > > [-Wformat] > > > ckhdid->data[0], ckhdid->data[1], > > > ^~~~~~~~~~~~~~~ > > > > I think the message is somewhat misguided as all the > > vararg arguments have implicit integer promotions. > > That's a fair point, but Clang checks the arguments against their > format specifier before they're promoted when using -Wformat. Perhaps clang could be a bit more verbose if checking signed types emitted as unsigned or unsigned types emitted as signed instead. > When > considering integer promotions it's difficult to say if this is > "wrong", I didn't write "wrong", I wrote misguided. > but since 'unsigned char' corresponds to the "hh" length > specifier I don't think this is misguided. Otherwise, why use the "h" > length specifier at all? e.g.: signed char as %x needs %hhx cheers, Joe