From d4863a5ca0bd3e9804366257e032ece5cc83114f Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Wed, 17 Mar 2021 17:49:56 -0700 Subject: tests: memset-test: Parenthesize zero size argument for clang When running coreboot unit tests on a recent clang version, it helpfully throws an error on memset(..., 0xAA, 0) because it thinks you probably made a typo and meant to write memset(..., 0, 0xAA) instead. I mean, who would ever memset() a buffer of zero bytes, right? Unfortunately, unit tests for memset() want to do exactly that. Wrapping the argument in parenthesis silences the warning. Signed-off-by: Julius Werner Change-Id: I21aeb5ec4d6ce74d5df2d21e2f9084b17b3ac6e3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51617 Tested-by: build bot (Jenkins) Reviewed-by: Jakub Czapiga Reviewed-by: Paul Menzel Reviewed-by: Angel Pons Reviewed-by: Paul Fagerburg --- tests/lib/memset-test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lib/memset-test.c b/tests/lib/memset-test.c index 1247577d08..2dde2b349d 100644 --- a/tests/lib/memset-test.c +++ b/tests/lib/memset-test.c @@ -85,7 +85,7 @@ static void test_memset_zero_size(void **state) } /* Expect no change in buffer after calling memset with zero size */ - memset(s->base_buffer, 0xAA, 0); + memset(s->base_buffer, 0xAA, (0)); assert_memory_equal(s->base_buffer, s->helper_buffer, MEMSET_BUFFER_SZ); } -- cgit v1.2.3