Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2016 15:32:53 -0800
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        Alan Somers <asomers@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, Sergey Kandaurov <pluknet@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>
Subject:   Re: svn commit: r295768 - head/usr.sbin/iostat
Message-ID:  <20160219233253.GU1945@FreeBSD.org>
In-Reply-To: <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org>
References:  <201602182008.u1IK81vg092127@repo.freebsd.org> <CAE-mSO%2B7p=Equq81PPQjfZv1piPydBr4Mnk363CEs3w9EXRi9w@mail.gmail.com> <CAOtMX2hyZ=GFgp8F6t0dMDYF5FSPdoP9KdMU7V5rmscpaPUnsw@mail.gmail.com> <83BB8467-4C40-4CF1-B394-1376C9D97FCF@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 20, 2016 at 12:23:40AM +0100, Dimitry Andric wrote:
D> You got this warning, most likely:
D> 
D> usr.sbin/iostat/iostat.c:122:15: error: missing field 'n_type' initializer [-Werror,-Wmissing-field-initializers]
D>         { "_tty_nin" },
D>                      ^
D> 
D> This warning is only produced when you use -Wall -W, and then initialize
D> structs partially, i.e. you initialize some fields but not others.  I
D> think this is a quite reasonable warning for a high warning level.
D> 
D> On the other hand, if this kind of construct is used throughout the
D> tree, and it is not seen as a big problem, we can simply silence this
D> particular warning using -Wno-missing-field -initializers.  There is
D> already quite a list of warnings which are suppressed by default, even
D> at WARNS=6, namely:
D> 
D> -Wno-empty-body
D> -Wno-format-y2k
D> -Wno-pointer-sign
D> -Wno-string-plus-int
D> -Wno-unused-const-variable
D> -Wno-unused-parameter

I think we should add -Wno-missing-field-initializers there. We use this
feature in the kernel intentionally, since it allows to write code that
is less dependant on API changes.

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160219233253.GU1945>