Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Dec 2020 08:16:33 +0000 (UTC)
From:      Ryan Libby <rlibby@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r368787 - stable/12/tests/sys/sys
Message-ID:  <202012190816.0BJ8GX6c052123@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rlibby
Date: Sat Dec 19 08:16:33 2020
New Revision: 368787
URL: https://svnweb.freebsd.org/changeset/base/368787

Log:
  MFC r354991-r354992 (by lwhsu)
  
  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

Modified:
  stable/12/tests/sys/sys/bitstring_test.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/tests/sys/sys/bitstring_test.c
==============================================================================
--- stable/12/tests/sys/sys/bitstring_test.c	Sat Dec 19 04:28:25 2020	(r368786)
+++ stable/12/tests/sys/sys/bitstring_test.c	Sat Dec 19 08:16:33 2020	(r368787)
@@ -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 */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012190816.0BJ8GX6c052123>