Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-22 Thread Dimitry Andric
On 22 Feb 2016, at 10:56, David Chisnall wrote: > > On 19 Feb 2016, at 23:23, Dimitry Andric 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 >>

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-22 Thread Gleb Smirnoff
On Fri, Feb 19, 2016 at 04:50:40PM -0800, Conrad Meyer wrote: C> > It is not quite as simple as this would make it sound. The elements or C> > members of an aggregate (e.g.) structure type are initialized as if it were C> > an object of static storage duration (i.e., to zero) if the initializer

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-22 Thread David Chisnall
On 22 Feb 2016, at 10:15, Kubilay Kocak wrote: > > For the lay persons among us (I'm genuinely interested), what are the > the downsides to requiring initialization of all fields? Explicit initialisation, or initialisation in general? Being able to initialise the entire

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-22 Thread Kubilay Kocak
On 22/02/2016 8:56 PM, David Chisnall wrote: > On 19 Feb 2016, at 23:23, Dimitry Andric 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

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-22 Thread David Chisnall
On 19 Feb 2016, at 23:23, Dimitry Andric 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

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-21 Thread Alan Somers
On Sun, Feb 21, 2016 at 3:00 PM, Andrew Turner wrote: > On Thu, 18 Feb 2016 20:08:01 + (UTC) > Alan Somers wrote: > >> Author: asomers >> Date: Thu Feb 18 20:08:01 2016 >> New Revision: 295768 >> URL: https://svnweb.freebsd.org/changeset/base/295768

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-21 Thread Andrew Turner
On Thu, 18 Feb 2016 20:08:01 + (UTC) Alan Somers wrote: > Author: asomers > Date: Thu Feb 18 20:08:01 2016 > New Revision: 295768 > URL: https://svnweb.freebsd.org/changeset/base/295768 > > Log: > Fix compiler warnings in iostat > > Raise WARNS from 1 to 6 (the

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Benjamin Kaduk
On Fri, Feb 19, 2016 at 6:50 PM, Conrad Meyer wrote: > On Fri, Feb 19, 2016 at 3:14 PM, Benjamin Kaduk wrote: > > On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff > wrote: > >> Isn't zero filling part of the standard? I don't see why lack

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Bruce Evans
On Sat, 20 Feb 2016, Dimitry Andric wrote: On 19 Feb 2016, at 16:49, Alan Somers wrote: On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: ... -struct nlist namelist[] = { +static struct nlist namelist[] = { #define X_TTY_NIN 0 - {

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Bruce Evans
On Fri, 19 Feb 2016, Benjamin Kaduk wrote: On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote: A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: A> Yeah, it was being implicitly

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Conrad Meyer
On Fri, Feb 19, 2016 at 3:14 PM, Benjamin Kaduk wrote: > On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: >> Isn't zero filling part of the standard? I don't see why lack of >> explicit zeroing is a warning? Looks a false warning to me. > > > It is

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Conrad Meyer
On Fri, Feb 19, 2016 at 3:06 PM, Gleb Smirnoff wrote: > Isn't zero filling part of the standard? I don't see why lack of > explicit zeroing is a warning? Looks a false warning to me. Yep. This is Clang being too whiney, IMO. I think a good workaround is to add

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Gleb Smirnoff
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

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Dimitry Andric
On 19 Feb 2016, at 16:49, Alan Somers wrote: > > On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: ... >>> -struct nlist namelist[] = { >>> +static struct nlist namelist[] = { >>> #define X_TTY_NIN 0 >>> - { "_tty_nin" }, >>> + {

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Benjamin Kaduk
On Fri, Feb 19, 2016 at 5:06 PM, Gleb Smirnoff wrote: > On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote: > A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov > wrote: > A> Yeah, it was being implicitly zeroized before. But Clang complained

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Gleb Smirnoff
On Fri, Feb 19, 2016 at 08:49:43AM -0700, Alan Somers wrote: A> On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: A> > On 18 February 2016 at 23:08, Alan Somers wrote: A> >> Author: asomers A> >> Date: Thu Feb 18 20:08:01 2016 A> >> New Revision:

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Alan Somers
On Fri, Feb 19, 2016 at 5:24 AM, Sergey Kandaurov wrote: > On 18 February 2016 at 23:08, Alan Somers wrote: >> Author: asomers >> Date: Thu Feb 18 20:08:01 2016 >> New Revision: 295768 >> URL: https://svnweb.freebsd.org/changeset/base/295768 >> >> Log: >>

Re: svn commit: r295768 - head/usr.sbin/iostat

2016-02-19 Thread Sergey Kandaurov
On 18 February 2016 at 23:08, Alan Somers wrote: > Author: asomers > Date: Thu Feb 18 20:08:01 2016 > New Revision: 295768 > URL: https://svnweb.freebsd.org/changeset/base/295768 > > Log: > Fix compiler warnings in iostat > Modified: head/usr.sbin/iostat/iostat.c >

svn commit: r295768 - head/usr.sbin/iostat

2016-02-18 Thread Alan Somers
Author: asomers Date: Thu Feb 18 20:08:01 2016 New Revision: 295768 URL: https://svnweb.freebsd.org/changeset/base/295768 Log: Fix compiler warnings in iostat Raise WARNS from 1 to 6 (the default) Fix warnings: * Use C99 designated initializers for structs, and initialize all fields