From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752411AbdIFXmQ (ORCPT ); Wed, 6 Sep 2017 19:42:16 -0400 Received: from smtprelay0245.hostedemail.com ([216.40.44.245]:50466 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751153AbdIFXmO (ORCPT ); Wed, 6 Sep 2017 19:42:14 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:2902:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:4321:4605:5007:6119:7903:9707:10004:10400:10848:11232:11658:11914:12295:12740:12760:12895:13069:13311:13357:13439:14181:14659:14721:21080:21627:30012:30054:30060:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: title50_303e3e830f961 X-Filterd-Recvd-Size: 1995 Message-ID: <1504741330.7546.6.camel@perches.com> Subject: Re: [PATCH] gpio: acpi: work around false-positive -Wstring-overflow warning From: Joe Perches To: Arnd Bergmann Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij , Dmitry Torokhov , Hans de Goede , Wei Yongjun , linux-gpio@vger.kernel.org, ACPI Devel Maling List , Linux Kernel Mailing List Date: Wed, 06 Sep 2017 16:42:10 -0700 In-Reply-To: References: <20170906154756.2133726-1-arnd@arndb.de> <1504713173.7546.3.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-09-06 at 21:53 +0200, Arnd Bergmann wrote: > On Wed, Sep 6, 2017 at 5:52 PM, Joe Perches wrote: > > On Wed, 2017-09-06 at 17:47 +0200, Arnd Bergmann wrote: > > > As suggested by Andy, this changes the format string to have a fixed length. > > > Since modifying the range check did not help, I also opened a bug against > > > gcc, see link below. > > > > The code has > > > > int pin > > > > does changing pin to unsigned int matter? > > No difference, see also the gcc bugzilla report. Perhaps the bug report does not apply here as the function is casting a unsigned int to an int through a pointer when the int could now be negative, the int is tested for < 256 and is then printed.