coreboot/util/cbfstool
Angel Pons 73cc8a413a treewide: Work around GCC 15 Werror=unterminated-string-initialization
GCC 15 added a new `unterminated-string-initialization` warning. Even
though crossgcc is still using GCC 14, some Linux distributions (e.g.
Arch Linux) already started shipping GCC 15. Given that coreboot uses
`-Werror` (warnings are errors), this new warning causes build errors
for things built using the host toolchain, such as utilities. In this
case, cbfstool is affected, which prevents building coreboot images.

The nonstring attribute is used to tell the compiler whether or not a
string is intentionally not null terminated. Since the attribute is
only included in GCC 15 for multidimensional character arrays (and even
later for clang) we need to check the GCC version before using the
attribute.

On GCC version prior to GCC 15 the nonstring attribute will not be used,
but that is not a problem since the unterminated-string-initialization
warning only exists since GCC 15. So you can still build on all GCC
versions as before. This way it also works if your host toolchain is GCC
15 (which builds commonlib code for cbfstool) and your coreboot cross
toolchain is GCC 14 (which builds commonlib code for coreboot).
Clang is a diffent matter. According to the documentation, the nonstring
attribute only exists in version 21 which is not yet released by LLVM.

TEST=Build qemu/Q35 successfully

Change-Id: I919d71cb2811e91869ba1ff493a0719ddcc86c36
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87825
Reviewed-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Nicholas Chin <nic.c3.14@gmail.com>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2025-06-09 07:19:09 +00:00
..
bpdt_formats util: Rename Makefiles from .inc to .mk 2024-01-26 12:43:18 +00:00
console util/cbfstool: Wrap logging macros in do - while 2022-10-13 17:07:02 +00:00
flashmap util/cbfstool: Refine type and signatures 2025-01-12 07:54:27 +00:00
fpt_formats util: Rename Makefiles from .inc to .mk 2024-01-26 12:43:18 +00:00
lz4 util: Add SPDX license headers to Makefiles 2022-11-22 12:47:09 +00:00
lzma
tests
.gitignore util/cbfstool/.gitignore: Add CSE tool executables 2021-11-29 18:44:34 +00:00
amdcompress.c
cbfs-mkpayload.c cbfs: Remove broken remnants of PAYLOAD_INFO feature 2024-03-13 18:51:11 +00:00
cbfs-mkstage.c util/cbfstool: Deal with how lld organizes loadable segments 2024-11-06 04:54:22 +00:00
cbfs-payload-linux.c util/cbfstool/cbfs-payload-linux: Add error handling 2024-08-20 01:41:59 +00:00
cbfs.h cbfstool: Add printing of legacy stage type 2024-03-27 14:00:56 +00:00
cbfs_glue.h cbfs/vboot: Adapt to new vb2_digest API 2022-09-02 23:51:29 +00:00
cbfs_image.c util/cbfstool: Add missing \n and use __func__ in debug messages 2025-02-27 16:24:53 +00:00
cbfs_image.h util/cbfstool: Fix truncate command error handling and cbfs_image_from_buffer() 2022-08-03 23:24:49 +00:00
cbfs_sections.c
cbfs_sections.h
cbfscomptool.c
cbfstool.c cbfstool: Fix the help text 2025-03-10 05:26:46 +00:00
coff.h
common.c treewide: Work around GCC 15 Werror=unterminated-string-initialization 2025-06-09 07:19:09 +00:00
common.h util/cbfstool/common.h Fix wrong return value doc 2024-08-05 13:10:08 +00:00
compress.c util/cbfstool: fix memory leak in compress.c 2022-11-02 21:40:25 +00:00
cse_fpt.c
cse_fpt.h
cse_helpers.c
cse_helpers.h
cse_serger.c region: Turn region_end() into an inclusive region_last() 2024-08-23 01:08:16 +00:00
cse_serger.h
default-x86.fmd mb/*/*/*.fmd: Start flash at 0 2025-04-09 17:11:43 +00:00
default.fmd mb/*/*/*.fmd: Start flash at 0 2025-04-09 17:11:43 +00:00
description.md
elf.h
elfheaders.c cbfstool: Read XIP stage alignment requirements from ELF 2024-06-20 19:34:14 +00:00
elfparsing.h cbfstool: Read XIP stage alignment requirements from ELF 2024-06-20 19:34:14 +00:00
elogtool.c util/cbfstool/eventlog: Use LocalTime or UTC timestamps 2023-03-02 13:05:35 +00:00
eventlog.c util/cbfstool/eventlog: Add low battery event type 2025-02-10 15:14:13 +00:00
eventlog.h util/cbfstool/eventlog: Use LocalTime or UTC timestamps 2023-03-02 13:05:35 +00:00
EXAMPLE
fdt.h
fit.c util/cbfstool: Add missing \n and use __func__ in debug messages 2025-02-27 16:24:53 +00:00
fit.h util/cbfstool: Add Intel platform boot policy support 2024-10-23 10:29:59 +00:00
flashmap_tests.c
flashrom.c util: Drop flashrom -p host alias which equals to -p internal 2023-09-25 14:06:32 +00:00
flashrom.h treewide: Unify Google branding 2022-07-04 14:02:26 +00:00
fmap_from_fmd.c
fmap_from_fmd.h
fmaptool.c
fmd.c
fmd.h
fmd_parser.c_shipped util/cbfstool: Revise lex/yacc (bison) generation 2023-09-28 21:28:37 +00:00
fmd_parser.h_shipped util/cbfstool: Revise lex/yacc (bison) generation 2023-09-28 21:28:37 +00:00
fmd_parser.y
fmd_scanner.c_shipped util/cbfstool: Revise lex/yacc (bison) generation 2023-09-28 21:28:37 +00:00
fmd_scanner.h_shipped util/cbfstool: Revise lex/yacc (bison) generation 2023-09-28 21:28:37 +00:00
fmd_scanner.l
fv.h
ifittool.c util/cbfstool: Add usage information about verbose output 2023-03-28 13:28:15 +00:00
ifwitool.c util: Use C99 flexible arrays 2023-08-01 12:51:25 +00:00
linux.h util/cbfstool: Qualify struct e820entry as packed 2023-04-16 14:04:32 +00:00
linux_trampoline.c util/cbfstool/linux_trampoline: Support more e820 entries 2024-02-18 07:50:28 +00:00
linux_trampoline.h
linux_trampoline.S util/cbfstool: Fix linux_trampoline.c generation 2024-06-03 16:54:02 +00:00
Makefile util: Break up spdx identifier text in scripts & makefiles 2024-06-19 17:42:43 +00:00
Makefile.mk util: Rename Makefiles from .inc to .mk 2024-01-26 12:43:18 +00:00
option.h
partitioned_file.c
partitioned_file.h
platform_fixups.c util/mtkheader: Rename to util/mediatek 2025-04-11 08:17:55 +00:00
ProcessorBind.h
rmodtool.c
rmodule.c cbfstool: Skip relocation entries pointing to undefined symbol 2023-10-20 14:32:20 +00:00
rmodule.h cbfstool: Make add-stage support multiple loadable segments 2023-09-14 21:01:56 +00:00
xdr.c