optimad / bitpit

Open source library for scientific HPC
http://optimad.github.io/bitpit/
GNU Lesser General Public License v3.0
117 stars 33 forks source link

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

Closed andrea-iob closed 2 years ago

andrea-iob commented 2 years ago

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; | ^~~