]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
gcc 8.10 compilation fix (#2914)
authorsameehj <sameeh.j@gmail.com>
Thu, 10 May 2018 03:39:46 +0000 (06:39 +0300)
committerJack Humbert <jack.humb@gmail.com>
Thu, 10 May 2018 03:39:46 +0000 (23:39 -0400)
* 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>
lib/lufa/LUFA/Drivers/USB/Class/Common/HIDParser.c
lib/lufa/LUFA/Drivers/USB/Core/Events.h

index 62f10c4e222f4f87cb47070f457e0251794d35bc..9250cad33a08aa0d05aac3bc92c3167daa6a77aa 100644 (file)
@@ -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));
 
index 57fd0d9af78829462512fd20a63e731b504142cf..91fb31b6205a6f5df5c1c910ce63ac61c1d7d606 100644 (file)
        #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);