Files
arm-trusted-firmware/lib/debugfs
Boyan Karatotev 1e969d01a6 fix(build): use assignment instead of memcpy to avoid a GCC 11 bug
GCC11 has a bug where it may produce an incorrect warning "writing 1 or
more bytes into a region of size 0 overflows the destination" when using
memcpy and memset [0]. Since we use -Werror, this warning is fatal and
prevents building certain configurations with GCC11. Enabling LTO makes
the problem worse as the compiler has more visibility to do a wider
analysis.

This patch fixes this by using syntactic assignment rather than library
functions in the places that most often cause problems. GCC11 is able to
correctly analyse those scenarios and does not emit a warning. There is
a slight upside to this in that it may be able to produce more optimal
code.

[0]: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106199

Change-Id: I897e6360b8619ba1d4587d3abf84ffdd31f17273
Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
2026-01-05 09:23:19 +00:00
..
2019-12-17 11:06:15 +01:00
2019-12-17 11:06:15 +01:00
2019-12-17 11:03:23 +01:00