From owner-svn-src-all@freebsd.org Mon May 21 08:56:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CFF6EE8D53; Mon, 21 May 2018 08:56:03 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from fry.fubar.geek.nz (fry.fubar.geek.nz [139.59.165.16]) by mx1.freebsd.org (Postfix) with ESMTP id EFB8E749AE; Mon, 21 May 2018 08:56:01 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from [IPv6:2a02:c7f:1e13:cf00:40a0:9da0:420:834b] (unknown [IPv6:2a02:c7f:1e13:cf00:40a0:9da0:420:834b]) by fry.fubar.geek.nz (Postfix) with ESMTPSA id 40D334E775; Mon, 21 May 2018 08:46:33 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: svn commit: r333959 - head/usr.bin/top From: Andrew Turner In-Reply-To: <201805210358.w4L3wFji081505@repo.freebsd.org> Date: Mon, 21 May 2018 09:46:31 +0100 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <9F97F4FF-0148-4889-8825-0237FFD09550@fubar.geek.nz> References: <201805210358.w4L3wFji081505@repo.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.3445.6.18) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2018 08:56:03 -0000 > On 21 May 2018, at 04:58, Eitan Adler wrote: >=20 > Author: eadler > Date: Mon May 21 03:58:15 2018 > New Revision: 333959 > URL: https://svnweb.freebsd.org/changeset/base/333959 >=20 > Log: > top(1): build with WARNS=3D3 >=20 > This fixes everything but > -Wincompatible-pointer-types-discards-qualifiers >=20 > Modified: > head/usr.bin/top/Makefile > head/usr.bin/top/display.c > head/usr.bin/top/display.h > head/usr.bin/top/machine.h > head/usr.bin/top/top.c >=20 > Modified: head/usr.bin/top/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/top/Makefile Mon May 21 03:36:16 2018 = (r333958) > +++ head/usr.bin/top/Makefile Mon May 21 03:58:15 2018 = (r333959) > @@ -7,7 +7,7 @@ SRCS+=3D sigdesc.h top.local.h > CFLAGS+=3D -I ${.OBJDIR} > MAN=3D top.1 >=20 > -WARNS?=3D 2 > +WARNS?=3D 3 >=20 > LIBADD=3D ncursesw m kvm jail >=20 >=20 > Modified: head/usr.bin/top/display.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/usr.bin/top/display.c Mon May 21 03:36:16 2018 = (r333958) > +++ head/usr.bin/top/display.c Mon May 21 03:58:15 2018 = (r333959) > @@ -32,6 +32,7 @@ >=20 > #include > #include > +#include > #include > #include > #include > @@ -1042,14 +1043,16 @@ display_header(int t) > } > } >=20 > -/*VARARGS2*/ > void > -new_message(int type, char *msgfmt, caddr_t a1, caddr_t a2, caddr_t = a3) > +new_message(int type, char *msgfmt, ...) > { > - int i; > + va_list args; > + size_t i; >=20 > + va_start(args, msgfmt); > + > /* first, format the message */ > - snprintf(next_msg, sizeof(next_msg), msgfmt, a1, a2, a3); > + snprintf(next_msg, sizeof(next_msg), msgfmt, args); >=20 > if (msglen > 0) > { You missed the call to va_end. You need to call va_end within the same = function, and after you have finished with args. See stdarg(3): Each invocation of va_start() or va_copy() must be paired with a = corresponding invocation of va_end() in the same function. Andrew