lkml.org 
[lkml]   [2014]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/7] Silence even more W=2 warnings
On Fri, Sep 19, 2014 at 08:29:33AM -0700, Jeff Kirsher wrote:
> The following patches silence over 100,000 warnings in a W=2
> kernel build. This series does most of it by using the compilers
> diagnostic controls. The first patch in the series adds macros to
> invoke the pragmas for those controls. Macros are provided for GCC
> and clang. Although they are highly compatible in this area, macros
> are provided for compiler-specific controls, and there is one
> example that uses a clang-specific control (look for DIAG_CLANG_IGNORE).
>
> Some missing-field-initializers warnings were resolved using
> the diagnostic control macros simply because so many lines
> would have had to have been changed. At this stage Mark thought
> about avoiding possible merge issues. If the maintainer would
> rather resolve them by using designated initialization, just
> say so.
>
> The combined effect of this patch series and his other patches
> that did not use these diagnostic control macros was to reduce
> the number of W=2 warnings from 127,164 to 1,345!

Sorry but I don't see the point of actively adding macros to the code
just so that gcc is happy. There's a reason why a bunch of warnings are
disabled in the normal build and only enabled with the W= switch.

The W= things are supposed to be used when developing code and have the
compiler tell you about *possible* issues. That doesn't mean though that
we have to actively "fix" otherwise perfectly fine code.

Having the need to actively go in and add code so that gcc doesn't issue
obscure warnings is going too far, IMO.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--


\
 
 \ /
  Last update: 2014-09-22 18:01    [W:0.171 / U:1.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site