From owner-svn-ports-all@freebsd.org Tue Oct 10 13:15:42 2017 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BEE9E3134A; Tue, 10 Oct 2017 13:15:42 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (xvm-110-62.dc2.ghst.net [46.226.110.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 119D281925; Tue, 10 Oct 2017 13:15:41 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from c124.sec.cl.cam.ac.uk (c124.sec.cl.cam.ac.uk [128.232.18.124]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id v9ADFXPf043712 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 10 Oct 2017 13:15:33 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r451623 - in head/net/tcpview: . files From: David Chisnall In-Reply-To: <201710101305.v9AD5k9x056952@slippy.cwsent.com> Date: Tue, 10 Oct 2017 14:15:32 +0100 Cc: Alexey Dokuchaev , Cy Schubert , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201710101305.v9AD5k9x056952@slippy.cwsent.com> To: Cy Schubert X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Oct 2017 13:15:42 -0000 On 10 Oct 2017, at 14:05, Cy Schubert wrote: >=20 >>>> gets(3) called only once in this port; why not simply patch that >>>> single call properly instead of bringing in a "poor man's" macro? >>>=20 >>> As an example. To open discussion of possibilities. >>=20 >> I don't think that having this (even in some extra-guarded form) is >> good *general* solution. Macros are fragile and things can go south >> when the argument is more just a simple pointer. >=20 > Which is the limitation of this. As I said, it was not perfict. This version, with no guards, looks quite dangerous. It=E2=80=99s = difficult to see from the context, but if str is a char*, then this will = always simply set the first byte to null, without reading anything. The = compilation will succeed, yet the code will behave in an unexpected way. = =20 David