From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from bh-25.webhostbox.net ([208.91.199.152]:38903 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754769AbdGLDKG (ORCPT ); Tue, 11 Jul 2017 23:10:06 -0400 Subject: Re: Lots of new warnings with gcc-7.1.1 To: Linus Torvalds , Tejun Heo , Jean Delvare , Bartlomiej Zolnierkiewicz , Sathya Prakash , "James E.J. Bottomley" , Greg Kroah-Hartman Cc: the arch/x86 maintainers , xen-devel , linux-block , Linux Media Mailing List , IDE-ML , "linux-fbdev@vger.kernel.org" , Network Development References: From: Guenter Roeck Message-ID: <848b3f21-9516-8a66-e4b3-9056ce38d6f6@roeck-us.net> Date: Tue, 11 Jul 2017 20:10:00 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 07/11/2017 03:35 PM, Linus Torvalds wrote: > [ Very random list of maintainers and mailing lists, at least > partially by number of warnings generated by gcc-7.1.1 that is then > correlated with the get_maintainers script ] > > So I upgraded one of my boxes to F26, which upgraded the compiler to gcc-7.1.1 > > Which in turn means that my nice clean allmodconfig compile is not an > unholy mess of annoying new warnings. > > Normally I hate the stupid new warnings, but this time around they are > actually exactly the kinds of warnings you'd want to see and that are > hard for humans to pick out errors: lots of format errors wrt limited > buffer sizes. > > At the same time, many of them *are* annoying. We have various limited > buffers that are limited for a good reason, and some of the format > truncation warnings are about numbers in the range {0-MAX_INT], where > we definitely know that we don't need to worry about the really big > ones. > > After all, we're using "snprintf()" for a reason - we *want* to > truncate if the buffer is too small. > The hwmon warnings are all about supporting no more than 9,999 sensors (applesmc) to 999,999,999 sensors (scpi) of a given type. Easy "fix" would be to replace snprintf() with scnprintf(), presumably because gcc doesn't know about scnprintf(). We could also increase the name buffer size. But is that really worth it just to silence gcc ? Guenter