File smartmontools-strict-aliasing.patch of Package smartmontools

os_linux.cpp: In member function 'bool os_linux::linux_megaraid_device::megasas_cmd(int, void*, int, void*, int, void*, int)':
os_linux.cpp:1097: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1092: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1091: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1079: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1078: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1077: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1076: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1075: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1074: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1073: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1072: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1071: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1070: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1069: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1068: warning: dereferencing pointer 'pthru' does break strict-aliasing rules
os_linux.cpp:1067: note: initialized from here
================================================================================
--- megaraid.h
+++ megaraid.h
@@ -212,6 +212,7 @@
 	union {
 		u8 raw[128];
 		struct megasas_header hdr;
+		struct megasas_pthru_frame pthru;
 	} frame;
 
 	struct iovec sgl[MAX_IOCTL_SGE];
--- os_linux.cpp
+++ os_linux.cpp
@@ -1064,7 +1064,7 @@
   int rc;
 
   memset(&uio, 0, sizeof(uio));
-  pthru = (struct megasas_pthru_frame *)uio.frame.raw;
+  pthru = &uio.frame.pthru;
   pthru->cmd = MFI_CMD_PD_SCSI_IO;
   pthru->cmd_status = 0xFF;
   pthru->scsi_status = 0x0;
openSUSE Build Service is sponsored by