aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Libby <rlibby@FreeBSD.org>2020-12-19 08:16:33 +0000
committerRyan Libby <rlibby@FreeBSD.org>2020-12-19 08:16:33 +0000
commitf4d0bc6aa6b90cbb0ea6cb993d9a10e36f5f4a4c (patch)
tree98db7229803a5c93e3132bc661201f204487eee9
parent1e2ccfc6c290defe415d33bcdcc49ac62ea5de7e (diff)
downloadsrc-f4d0bc6aa6b90cbb0ea6cb993d9a10e36f5f4a4c.tar.gz
src-f4d0bc6aa6b90cbb0ea6cb993d9a10e36f5f4a4c.zip
MFC r354991-r354992 (by lwhsu)stable/12
r354991: Fix GCC build. Sponsored by: The FreeBSD Foundation r354992: Initialize variable bitstr r354991 removed variable-sized object initializing on defining. For the safe reason, manually initialize the members to 0. Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/stable/12/; revision=368787
-rw-r--r--tests/sys/sys/bitstring_test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/sys/sys/bitstring_test.c b/tests/sys/sys/bitstring_test.c
index 713ad4d4bac7..8fdc68ecf68e 100644
--- a/tests/sys/sys/bitstring_test.c
+++ b/tests/sys/sys/bitstring_test.c
@@ -347,9 +347,11 @@ ATF_TC_WITHOUT_HEAD(bit_ffs_area);
ATF_TC_BODY(bit_ffs_area, tc)
{
const int nbits = 72;
- bitstr_t bit_decl(bitstr, nbits) = {};
+ bitstr_t bit_decl(bitstr, nbits);
int location;
+ memset(bitstr, 0, bitstr_size(nbits));
+
bit_set(bitstr, 5);
bit_set(bitstr, 6);
@@ -416,7 +418,7 @@ ATF_TC_WITHOUT_HEAD(bit_ffc_area);
ATF_TC_BODY(bit_ffc_area, tc)
{
const int nbits = 80;
- bitstr_t bit_decl(bitstr, nbits) = {};
+ bitstr_t bit_decl(bitstr, nbits);
int location;
/* set all bits */