From 84bfe0e04e78863e386783f573808e02d422620c Mon Sep 17 00:00:00 2001 From: Anastasia Klimchuk Date: Sat, 21 Sep 2024 21:37:55 +1000 Subject: [PATCH] tests: Add header stdlib.h to allow scan-build to do analysis Without the header being explicitly included, scan-build run on CI was returning errors for these files, such as: include the header or explicitly provide a declaration for 'calloc' The functions in question were calloc, free, etc. Change-Id: I4b79c5f86c074c456533296c309293e4064abe3f Signed-off-by: Anastasia Klimchuk Reviewed-on: https://review.coreboot.org/c/flashrom/+/84455 Reviewed-by: Stefan Reinauer Tested-by: build bot (Jenkins) --- tests/ch341a_spi.c | 2 ++ tests/chip_wp.c | 1 + tests/erase_func_algo.c | 1 + tests/flashrom.c | 3 ++- tests/helpers.c | 1 + tests/linux_mtd.c | 2 ++ tests/raiden_debug_spi.c | 2 ++ tests/tests.c | 1 + 8 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/ch341a_spi.c b/tests/ch341a_spi.c index 1cb265249..50b3d11db 100644 --- a/tests/ch341a_spi.c +++ b/tests/ch341a_spi.c @@ -13,6 +13,8 @@ * GNU General Public License for more details. */ +#include + #include "lifecycle.h" #if CONFIG_CH341A_SPI == 1 diff --git a/tests/chip_wp.c b/tests/chip_wp.c index 1fa6bb9c8..4f0162d33 100644 --- a/tests/chip_wp.c +++ b/tests/chip_wp.c @@ -16,6 +16,7 @@ #include #include +#include #include #include "chipdrivers.h" diff --git a/tests/erase_func_algo.c b/tests/erase_func_algo.c index b2a09dce2..d947eb965 100644 --- a/tests/erase_func_algo.c +++ b/tests/erase_func_algo.c @@ -13,6 +13,7 @@ #include #include +#include #include #include "tests.h" diff --git a/tests/flashrom.c b/tests/flashrom.c index cc8883132..52cc9c85a 100644 --- a/tests/flashrom.c +++ b/tests/flashrom.c @@ -13,9 +13,10 @@ * GNU General Public License for more details. */ +#include + #include #include "tests.h" - #include "programmer.h" #define assert_equal_and_free(text, expected) \ diff --git a/tests/helpers.c b/tests/helpers.c index 271fb4831..95a161994 100644 --- a/tests/helpers.c +++ b/tests/helpers.c @@ -19,6 +19,7 @@ #include "flash.h" #include +#include void address_to_bits_test_success(void **state) { diff --git a/tests/linux_mtd.c b/tests/linux_mtd.c index 3aaa5abda..0cee7857c 100644 --- a/tests/linux_mtd.c +++ b/tests/linux_mtd.c @@ -13,6 +13,8 @@ * GNU General Public License for more details. */ +#include + #include "lifecycle.h" #if CONFIG_LINUX_MTD == 1 diff --git a/tests/raiden_debug_spi.c b/tests/raiden_debug_spi.c index 4f0bdd3f9..8ec0617dc 100644 --- a/tests/raiden_debug_spi.c +++ b/tests/raiden_debug_spi.c @@ -13,6 +13,8 @@ * GNU General Public License for more details. */ +#include + #include "lifecycle.h" #if CONFIG_RAIDEN_DEBUG_SPI == 1 diff --git a/tests/tests.c b/tests/tests.c index 8a9dc6b4f..3fee05681 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -20,6 +20,7 @@ #include "io_real.h" #include +#include #include #include #include