Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Feb 2016 09:56:05 +0000
From:      David Chisnall <theraven@FreeBSD.org>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        Alan Somers <asomers@freebsd.org>, Sergey Kandaurov <pluknet@gmail.com>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r295768 - head/usr.sbin/iostat
Message-ID:  <156A6796-D62B-4977-893B-E4E727578412@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 19 Feb 2016, at 23:23, Dimitry Andric <dim@FreeBSD.org> wrote:
> 
> This warning is only produced when you use -Wall -W, and then initialize
> structs partially, i.e. you initialize some fields but not others.  I
> think this is a quite reasonable warning for a high warning level.

The warning is annoying in many ways.  You ought to be able to zero initialise any struct with {0}, but clang objects if you do this and requires every field to be filled in.  This warning really shouldn’t be enabled with -Wall, because it has too hight a false positive rate.

With regard to Bruce’s comment about padding, this is a known issue in C11.  There is an open DR about it and it’s scheduled for discussion at the WG14 meeting in London in April.

David




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?156A6796-D62B-4977-893B-E4E727578412>