]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Basetools: turn off gcc12 warning
authorGerd Hoffmann <kraxel@redhat.com>
Thu, 24 Mar 2022 12:04:36 +0000 (20:04 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Mon, 28 Mar 2022 00:51:30 +0000 (00:51 +0000)
In function ?SetDevicePathEndNode?,
    inlined from ?FileDevicePath? at DevicePathUtilities.c:857:5:
DevicePathUtilities.c:321:3: error: writing 4 bytes into a region of size 1 [-Werror=stringop-overflow=]
  321 |   memcpy (Node, &mUefiDevicePathLibEndDevicePath, sizeof (mUefiDevicePathLibEndDevicePath));
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from UefiDevicePathLib.h:22,
                 from DevicePathUtilities.c:16:
../Include/Protocol/DevicePath.h: In function ?FileDevicePath?:
../Include/Protocol/DevicePath.h:51:9: note: destination object ?Type? of size 1
   51 |   UINT8 Type;       ///< 0x01 Hardware Device Path.
      |         ^~~~

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/C/DevicePath/GNUmakefile

index 7ca08af9662d50a43745547329bb7dc5613d4356..b05d2bddfa68c977dadcb50545095f5da26c94db 100644 (file)
@@ -13,6 +13,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 \r
 include $(MAKEROOT)/Makefiles/app.makefile\r
 \r
+# gcc 12 trips over device path handling\r
+BUILD_CFLAGS += -Wno-error=stringop-overflow\r
+\r
 LIBS = -lCommon\r
 ifeq ($(CYGWIN), CYGWIN)\r
   LIBS += -L/lib/e2fsprogs -luuid\r