public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gerd Hoffmann" <kraxel@redhat.com>
To: devel@edk2.groups.io
Cc: Pawel Polawski <ppolawsk@redhat.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Yuwei Chen <yuwei.chen@intel.com>,
	Oliver Steffen <osteffen@redhat.com>,
	Bob Feng <bob.c.feng@intel.com>,
	Gerd Hoffmann <kraxel@redhat.com>
Subject: [PATCH 3/3] Basetools: turn off gcc12 warning
Date: Thu, 24 Mar 2022 13:04:36 +0100	[thread overview]
Message-ID: <20220324120436.939688-4-kraxel@redhat.com> (raw)
In-Reply-To: <20220324120436.939688-1-kraxel@redhat.com>

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>
---
 BaseTools/Source/C/DevicePath/GNUmakefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index 7ca08af9662d..b05d2bddfa68 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,6 +13,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 
 include $(MAKEROOT)/Makefiles/app.makefile
 
+# gcc 12 trips over device path handling
+BUILD_CFLAGS += -Wno-error=stringop-overflow
+
 LIBS = -lCommon
 ifeq ($(CYGWIN), CYGWIN)
   LIBS += -L/lib/e2fsprogs -luuid
-- 
2.35.1


  parent reply	other threads:[~2022-03-24 12:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24 12:04 [PATCH 0/3] BaseTools: patches to build with gcc12 Gerd Hoffmann
2022-03-24 12:04 ` [PATCH 1/3] BaseTools: fix gcc12 warning Gerd Hoffmann
2022-03-24 12:04 ` [PATCH 2/3] " Gerd Hoffmann
2022-03-24 12:04 ` Gerd Hoffmann [this message]
2022-03-28 21:29   ` [edk2-devel] [PATCH 3/3] Basetools: turn off " Rebecca Cran
2022-03-29  4:00     ` Bob Feng
2022-03-29 18:14       ` grant
2022-03-29 21:38         ` Andrew Fish
     [not found]         ` <16E0F7C6F57A7FEC.28871@groups.io>
2022-03-29 21:39           ` Andrew Fish
2022-03-26 13:57 ` [edk2-devel] [PATCH 0/3] BaseTools: patches to build with gcc12 Bob Feng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220324120436.939688-4-kraxel@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox