svn commit: r311811 - head/usr.sbin/mfiutil
Dimitry Andric
dim at FreeBSD.org
Mon Jan 9 19:39:37 UTC 2017
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);
More information about the svn-src-all
mailing list