Skip to content

Commit c73b8be

Browse files
committed
Explicitly initialize prevector::_union to avoid new warning
Warning from gcc 7.1 is ./prevector.h:450:25: warning: '*((void*)(&<anonymous>)+8).prevector<28, unsigned char>::_union.prevector<28, unsigned char>::direct_or_indirect::<anonymous>.prevector<28, unsigned char>::direct_or_indirect::<unnamed struct>::indirect' may be used uninitialized in this function [-Wmaybe-uninitialized]
1 parent 1016dac commit c73b8be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/prevector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class prevector {
220220
}
221221
}
222222

223-
prevector() : _size(0) {}
223+
prevector() : _size(0), _union{{}} {}
224224

225225
explicit prevector(size_type n) : _size(0) {
226226
resize(n);

0 commit comments

Comments
 (0)