mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 16:09:52 +02:00
can-utils: remove strict-aliasing compiler warning
GitHub user 'crossband' raised an issue regarding the strict-aliasing compiler warning in his specific setup: https://github.com/linux-can/can-utils/issues/42 In fact memcpy() and memset() are a better solution than the former pointer magics, so remove the issues and the compiler warning flag too. Reported-by: crossband (https://github.com/crossband) Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -689,9 +689,9 @@ int main(int argc, char **argv)
|
||||
cmsg && (cmsg->cmsg_level == SOL_SOCKET);
|
||||
cmsg = CMSG_NXTHDR(&msg,cmsg)) {
|
||||
if (cmsg->cmsg_type == SO_TIMESTAMP)
|
||||
tv = *(struct timeval *)CMSG_DATA(cmsg);
|
||||
memcpy(&tv, CMSG_DATA(cmsg), sizeof(tv));
|
||||
else if (cmsg->cmsg_type == SO_RXQ_OVFL)
|
||||
dropcnt[i] = *(__u32 *)CMSG_DATA(cmsg);
|
||||
memcpy(&dropcnt[i], CMSG_DATA(cmsg), sizeof(__u32));
|
||||
}
|
||||
|
||||
/* check for (unlikely) dropped frames on this specific socket */
|
||||
|
||||
Reference in New Issue
Block a user