From owner-svn-src-head@freebsd.org Mon Jan 9 19:39:37 2017 Return-Path: Delivered-To: svn-src-head@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 1B2E0CA61B9; Mon, 9 Jan 2017 19:39:37 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E0DA310A8; Mon, 9 Jan 2017 19:39:36 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v09JdaAB050295; Mon, 9 Jan 2017 19:39:36 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v09JdawM050294; Mon, 9 Jan 2017 19:39:36 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201701091939.v09JdawM050294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 9 Jan 2017 19:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r311811 - head/usr.sbin/mfiutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 09 Jan 2017 19:39:37 -0000 Author: dim Date: Mon Jan 9 19:39:35 2017 New Revision: 311811 URL: https://svnweb.freebsd.org/changeset/base/311811 Log: Avoid taking the address of a packed struct member in mfiutil Fix a clang 4.0.0 warning about taking the address of a packed member of struct mfi_evt in mfiutil: usr.sbin/mfiutil/mfi_evt.c:583:30: error: taking address of packed member 'members' of class or structure 'mfi_evt' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] if (parse_locale(optarg, &filter.members.locale) < 0) { ^~~~~~~~~~~~~~~~~~~~~ Use a local variable instead, and copy that into the struct. Reviewed by: jhb MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D9069 Modified: head/usr.sbin/mfiutil/mfi_evt.c Modified: head/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- head/usr.sbin/mfiutil/mfi_evt.c Mon Jan 9 19:37:17 2017 (r311810) +++ head/usr.sbin/mfiutil/mfi_evt.c Mon Jan 9 19:39:35 2017 (r311811) @@ -540,6 +540,7 @@ show_events(int ac, char **av) char *cp; ssize_t size; uint32_t seq, start, stop; + uint16_t locale; uint8_t status; int ch, error, fd, num_events, verbose; u_int i; @@ -580,12 +581,13 @@ show_events(int ac, char **av) } break; case 'l': - if (parse_locale(optarg, &filter.members.locale) < 0) { + if (parse_locale(optarg, &locale) < 0) { error = errno; warn("Error parsing event locale"); close(fd); return (error); } + filter.members.locale = locale; break; case 'n': val = strtol(optarg, &cp, 0);