mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-22 08:06:34 +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:
+1
-1
@@ -246,7 +246,7 @@ rx_restart:
|
||||
else
|
||||
ptr = 9; /* dlc position Tiiiiiiiid */
|
||||
|
||||
*(unsigned long long *) (&frame.data) = 0ULL; /* clear data[] */
|
||||
memset(&frame.data, 0, 8); /* clear data[] */
|
||||
|
||||
if ((cmd | 0x20) == 'r' && buf[ptr] != '0') {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user