Commit 9299735c authored by Dean Camera's avatar Dean Camera
Browse files

Disable strict aliasing explicitly in the project makefiles, as this is...

Disable strict aliasing explicitly in the project makefiles, as this is apparently enabled by default in newer AVR-GCC builds, and aliasing is used heavily for type-punning through the LUFA and third party library's codebase.
parent f4710f6f
...@@ -211,6 +211,7 @@ CFLAGS += -ffunction-sections ...@@ -211,6 +211,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -213,6 +213,7 @@ CFLAGS += -fdata-sections ...@@ -213,6 +213,7 @@ CFLAGS += -fdata-sections
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -213,6 +213,7 @@ CFLAGS += -ffunction-sections ...@@ -213,6 +213,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -214,6 +214,7 @@ CFLAGS += -ffunction-sections ...@@ -214,6 +214,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -214,6 +214,7 @@ CFLAGS += -ffunction-sections ...@@ -214,6 +214,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections ...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections ...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections ...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections ...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -213,6 +213,7 @@ CFLAGS += -ffunction-sections ...@@ -213,6 +213,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -138,7 +138,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) ...@@ -138,7 +138,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
*/ */
static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static void SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
{ {
uint16_t AllocationLength = SwapEndian_16(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]); uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);
uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength : uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength :
sizeof(InquiryData); sizeof(InquiryData);
...@@ -256,7 +256,7 @@ static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo ...@@ -256,7 +256,7 @@ static void SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo
BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]); BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
/* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */ /* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */
TotalBlocks = SwapEndian_16(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
/* Check if the block address is outside the maximum allowable value for the LUN */ /* Check if the block address is outside the maximum allowable value for the LUN */
if (BlockAddress >= LUN_MEDIA_BLOCKS) if (BlockAddress >= LUN_MEDIA_BLOCKS)
......
...@@ -217,6 +217,7 @@ CFLAGS += -ffunction-sections ...@@ -217,6 +217,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -148,7 +148,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) ...@@ -148,7 +148,7 @@ bool SCSI_DecodeSCSICommand(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
*/ */
static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo) static bool SCSI_Command_Inquiry(USB_ClassInfo_MS_Device_t* MSInterfaceInfo)
{ {
uint16_t AllocationLength = SwapEndian_16(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]); uint16_t AllocationLength = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[3]);
uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength : uint16_t BytesTransferred = (AllocationLength < sizeof(InquiryData))? AllocationLength :
sizeof(InquiryData); sizeof(InquiryData);
...@@ -309,7 +309,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo ...@@ -309,7 +309,7 @@ static bool SCSI_Command_ReadWrite_10(USB_ClassInfo_MS_Device_t* MSInterfaceInfo
BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]); BlockAddress = SwapEndian_32(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[2]);
/* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */ /* Load in the 16-bit total blocks (SCSI uses big-endian, so have to reverse the byte order) */
TotalBlocks = SwapEndian_16(*(uint32_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]); TotalBlocks = SwapEndian_16(*(uint16_t*)&MSInterfaceInfo->State.CommandBlock.SCSICommandData[7]);
/* Check if the block address is outside the maximum allowable value for the LUN */ /* Check if the block address is outside the maximum allowable value for the LUN */
if (BlockAddress >= LUN_MEDIA_BLOCKS) if (BlockAddress >= LUN_MEDIA_BLOCKS)
......
...@@ -224,9 +224,10 @@ CFLAGS += -O$(OPT) ...@@ -224,9 +224,10 @@ CFLAGS += -O$(OPT)
CFLAGS += -funsigned-char CFLAGS += -funsigned-char
CFLAGS += -funsigned-bitfields CFLAGS += -funsigned-bitfields
CFLAGS += -ffunction-sections CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -finline-limit=20 CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections ...@@ -215,6 +215,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
#CFLAGS += -mshort-calls #CFLAGS += -mshort-calls
......
...@@ -226,6 +226,7 @@ CFLAGS += -ffunction-sections ...@@ -226,6 +226,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -214,6 +214,7 @@ CFLAGS += -ffunction-sections ...@@ -214,6 +214,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -216,6 +216,7 @@ CFLAGS += -ffunction-sections ...@@ -216,6 +216,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -219,6 +219,7 @@ CFLAGS += -ffunction-sections ...@@ -219,6 +219,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
...@@ -213,6 +213,7 @@ CFLAGS += -ffunction-sections ...@@ -213,6 +213,7 @@ CFLAGS += -ffunction-sections
CFLAGS += -fno-inline-small-functions CFLAGS += -fno-inline-small-functions
CFLAGS += -fpack-struct CFLAGS += -fpack-struct
CFLAGS += -fshort-enums CFLAGS += -fshort-enums
CFLAGS += -fno-strict-aliasing
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes
CFLAGS += -Wundef CFLAGS += -Wundef
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment