Skip to content

Commit

Permalink
gcc 8.10 compilation fix (qmk#2914)
Browse files Browse the repository at this point in the history
* Use memmove instead of memcpy

gcc 8.1 gives the following error:
lib/lufa/LUFA/Drivers/USB/Class/Common/HIDParser.c:93:5: error: 'memcpy' accessing 42 bytes at offsets 28 and 0 overlaps 14 bytes at offset 28 [-Werror=restrict]

This patch resolve this by using memmove instead

Signed-off-by: Sameeh <Sameeh Jubran>

* Remove ATTR_CONST from a void returning function

gcc 8.10 gives the following error when attempting to compile
lib/lufa/LUFA/Drivers/USB/Core/Events.h:334:5: error: 'const' attribute on function returning 'void' [-Werror=attributes]

Signed-off-by: Sameeh <Sameeh Jubran>
  • Loading branch information
sameehj authored and jackhumbert committed May 10, 2018
1 parent 00596d5 commit 03516d5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/lufa/LUFA/Drivers/USB/Class/Common/HIDParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ uint8_t USB_ProcessHIDReport(const uint8_t* ReportData,
if (CurrStateTable == &StateTable[HID_STATETABLE_STACK_DEPTH - 1])
return HID_PARSE_HIDStackOverflow;

memcpy((CurrStateTable + 1),
memmove(CurrStateTable + 1,
CurrStateTable,
sizeof(HID_ReportItem_t));

Expand Down
2 changes: 1 addition & 1 deletion lib/lufa/LUFA/Drivers/USB/Core/Events.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@
#if !defined(__DOXYGEN__)
/* Function Prototypes: */
#if defined(__INCLUDE_FROM_EVENTS_C)
void USB_Event_Stub(void) ATTR_CONST;
void USB_Event_Stub(void);

#if defined(USB_CAN_BE_BOTH)
void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub);
Expand Down

0 comments on commit 03516d5

Please sign in to comment.