[CXX-1892] Coverity analysis defect 105006: Uninitialized scalar field Created: 16/Dec/19  Updated: 27/Oct/23  Resolved: 21/Jul/23

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Coverity Collector User Assignee: Unassigned
Resolution: Gone away Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: CXX-2632
Quarter: FY24Q2

 Description   

A scalar field is not initialized by the constructor

Defect 105006 (STATIC_C)
Checker UNINIT_CTOR (subcategory none)
File: /src/bsoncxx/private/stack.hh
Function bsoncxx::v_noabi::stack<bsoncxx::v_noabi::builder::core::impl::frame, (unsigned long)4>::stack()
/usr/include/c++/7/type_traits, line: 2046
Class member declaration for "__align".

    	struct __attribute__((__aligned__((_Align)))) { } __align;

/src/bsoncxx/private/stack.hh, line: 31
Non-static class member field "object_memory._align" is not initialized in this constructor nor in any functions that it calls.

        stack() : _bucket_index(0), _bucket_size(size), _is_empty(true) {}



 Comments   
Comment by Kevin Albertson [ 16/Dec/19 ]

Investigate to see whether this really is an issue or if leaving this field uninitialized is ok.

Generated at Wed Feb 07 22:04:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.