summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2021-03-17 17:49:56 -0700
committerPaul Fagerburg <pfagerburg@chromium.org>2021-03-18 15:02:13 +0000
commitd4863a5ca0bd3e9804366257e032ece5cc83114f (patch)
tree10c9de731c1beed82cce88e0b494b4f2f2a803f8
parenta699240612d252bb3e7968f28d54de795ba8648c (diff)
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 <jwerner@chromium.org> Change-Id: I21aeb5ec4d6ce74d5df2d21e2f9084b17b3ac6e3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/51617 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jakub Czapiga <jacz@semihalf.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--tests/lib/memset-test.c2
1 files changed, 1 insertions, 1 deletions
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);
}