bitpit icon indicating copy to clipboard operation
bitpit copied to clipboard

IO/DGF: make sure the current position in the file is properly initialized

Open andrea-iob opened this issue 2 years ago • 0 comments

Fixes the following GCC warning:

In constructor ‘std::fpos<_StateT>::fpos(std::streamoff) [with _StateT = __mbstate_t]’, inlined from ‘unsigned int bitpit::dgf::checkData(std::ifstream&, int&)’ at /home/andrea/work/customers/optimad/present/20150716_bitpit/code/src/IO/DGF.cpp:1142:22: /usr/include/c++/12/bits/postypes.h:104:9: warning: ‘current_pos’ may be used uninitialized [-Wmaybe-uninitialized] 104 | : _M_off(__off), _M_state() { } | ^~~~~~~~~~~~~ /code/src/IO/DGF.cpp: In function ‘unsigned int bitpit::dgf::checkData(std::ifstream&, int&)’: /code/src/IO/DGF.cpp:1100:17: note: ‘current_pos’ was declared here 1100 | long int current_pos; | ^~~~~~~~~~~

andrea-iob avatar Jun 26 '22 12:06 andrea-iob