Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(cli): work around GCC false positive warning
GCC complains that arg_var might not be initialized: vector.h:238:23: error: '*((void*)& next_vim_file_bufnr +8)' may be used uninitialized in this function [-Werror=maybe-uninitialized] 238 | this->data_end_ = new (this->data_end_) T(std::forward<Args>(args)...); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ options.cpp:36:5: note: '*((void*)& next_vim_file_bufnr +8)' was declared here 36 | } next_vim_file_bufnr; | ^~~~~~~~~~~~~~~~~~~ This is a false positive in GCC. Whenever arg_var is pushed onto a Vector, we check if number is non-null. Whenever number is non-null, arg_var is initialized. Work around the false positive by refactoring the code such that arg_var and number are initialized together.
- Loading branch information