From owner-svn-src-head@freebsd.org Thu May 24 13:26:16 2018 Return-Path: Delivered-To: svn-src-head@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 031CBEF1319; Thu, 24 May 2018 13:26:16 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09B956B907; Thu, 24 May 2018 13:26:14 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w4ODQ9Kh040439; Thu, 24 May 2018 06:26:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w4ODQ9Wh040438; Thu, 24 May 2018 06:26:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201805241326.w4ODQ9Wh040438@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r334077 - in head/sbin/devd: . tests In-Reply-To: To: Eitan Adler Date: Thu, 24 May 2018 06:26:09 -0700 (PDT) CC: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 May 2018 13:26:16 -0000 > On 23 May 2018 at 13:09, Warner Losh wrote: > > > > > > On Wed, May 23, 2018 at 1:39 AM, Eitan Adler wrote: > >> > >> Author: eadler > >> Date: Wed May 23 07:39:02 2018 > >> New Revision: 334077 > >> URL: https://svnweb.freebsd.org/changeset/base/334077 > >> > >> Log: > >> devd: correct two warnings > >> > >> - catching a polymorphic type by value > >> - "output between 16 and 95 bytes into a destination of size 80" > >> > >> Modified: > >> head/sbin/devd/devd.cc > >> head/sbin/devd/tests/client_test.c > >> > >> Modified: head/sbin/devd/devd.cc > >> > >> ============================================================================== > >> --- head/sbin/devd/devd.cc Wed May 23 07:39:00 2018 (r334076) > >> +++ head/sbin/devd/devd.cc Wed May 23 07:39:02 2018 (r334077) > >> @@ -1087,7 +1087,7 @@ event_loop(void) > >> try { > >> process_event(buffer); > >> } > >> - catch (std::length_error e) { > >> + catch (const std::length_error& e) { > >> devdlog(LOG_ERR, "Dropping event > >> %s " > >> "due to low memory", buffer); > >> } > >> > >> Modified: head/sbin/devd/tests/client_test.c > >> > >> ============================================================================== > >> --- head/sbin/devd/tests/client_test.c Wed May 23 07:39:00 2018 > >> (r334076) > >> +++ head/sbin/devd/tests/client_test.c Wed May 23 07:39:02 2018 > >> (r334077) > >> @@ -50,7 +50,7 @@ create_two_events(void) > >> FILE *create_stdout; > >> FILE *destroy_stdout; > >> char mdname[80]; > >> - char destroy_cmd[80]; > >> + char destroy_cmd[95]; > >> char *error; > > > > > > I know it's just a test, but 95 seems equally as magical as 80... > > Agreed. I stole this number from the warning without too much thought. > Tested that it still passed, and didn't do anything funky. It is extremly dangerous to be driven by compiler warnings, it has driven some developers write off the major bug cliff causing serious security issues. -- Rod Grimes rgrimes@freebsd.org