Anastasia Klimchuk has submitted this change. ( https://review.coreboot.org/c/flashrom/+/84455?usp=email )
(
1 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: tests: Add header stdlib.h to allow scan-build to do analysis ......................................................................
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 <stdlib.h> or explicitly provide a declaration for 'calloc'
The functions in question were calloc, free, etc.
Change-Id: I4b79c5f86c074c456533296c309293e4064abe3f Signed-off-by: Anastasia Klimchuk aklm@flashrom.org Reviewed-on: https://review.coreboot.org/c/flashrom/+/84455 Reviewed-by: Stefan Reinauer stefan.reinauer@coreboot.org Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M tests/ch341a_spi.c M tests/chip_wp.c M tests/erase_func_algo.c M tests/flashrom.c M tests/helpers.c M tests/linux_mtd.c M tests/raiden_debug_spi.c M tests/tests.c 8 files changed, 12 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Stefan Reinauer: Looks good to me, approved
diff --git a/tests/ch341a_spi.c b/tests/ch341a_spi.c index 1cb2652..50b3d11 100644 --- a/tests/ch341a_spi.c +++ b/tests/ch341a_spi.c @@ -13,6 +13,8 @@ * GNU General Public License for more details. */
+#include <stdlib.h> + #include "lifecycle.h"
#if CONFIG_CH341A_SPI == 1 diff --git a/tests/chip_wp.c b/tests/chip_wp.c index 1fa6bb9..4f0162d 100644 --- a/tests/chip_wp.c +++ b/tests/chip_wp.c @@ -16,6 +16,7 @@
#include <include/test.h> #include <stdio.h> +#include <stdlib.h> #include <string.h>
#include "chipdrivers.h" diff --git a/tests/erase_func_algo.c b/tests/erase_func_algo.c index b2a09dc..d947eb9 100644 --- a/tests/erase_func_algo.c +++ b/tests/erase_func_algo.c @@ -13,6 +13,7 @@
#include <include/test.h> #include <stdio.h> +#include <stdlib.h> #include <string.h>
#include "tests.h" diff --git a/tests/flashrom.c b/tests/flashrom.c index cc88831..52cc9c8 100644 --- a/tests/flashrom.c +++ b/tests/flashrom.c @@ -13,9 +13,10 @@ * GNU General Public License for more details. */
+#include <stdlib.h> + #include <include/test.h> #include "tests.h" - #include "programmer.h"
#define assert_equal_and_free(text, expected) \ diff --git a/tests/helpers.c b/tests/helpers.c index 271fb48..95a1619 100644 --- a/tests/helpers.c +++ b/tests/helpers.c @@ -19,6 +19,7 @@ #include "flash.h"
#include <stdint.h> +#include <stdlib.h>
void address_to_bits_test_success(void **state) { diff --git a/tests/linux_mtd.c b/tests/linux_mtd.c index 3aaa5ab..0cee785 100644 --- a/tests/linux_mtd.c +++ b/tests/linux_mtd.c @@ -13,6 +13,8 @@ * GNU General Public License for more details. */
+#include <stdlib.h> + #include "lifecycle.h"
#if CONFIG_LINUX_MTD == 1 diff --git a/tests/raiden_debug_spi.c b/tests/raiden_debug_spi.c index 4f0bdd3..8ec0617 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 <stdlib.h> + #include "lifecycle.h"
#if CONFIG_RAIDEN_DEBUG_SPI == 1 diff --git a/tests/tests.c b/tests/tests.c index 8a9dc6b..3fee056 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -20,6 +20,7 @@ #include "io_real.h"
#include <stdio.h> +#include <stdlib.h> #include <string.h> #include <stdint.h> #include <pthread.h>