Warning observed building Cardinal
Opened this issue · 0 comments
cosinekitty commented
While building Cardinal this morning, I saw this warning about possibly using uninitialized memory. I thought you might be interested.
Compiling BaconPlugs/libs/midifile/src/Options.cpp
In file included from /home/don/gcc12/include/c++/12.2.0/ios:40,
from /home/don/gcc12/include/c++/12.2.0/ostream:38,
from /home/don/gcc12/include/c++/12.2.0/iostream:39,
from BaconPlugs/libs/midifile/include/Options.h:17,
from BaconPlugs/libs/midifile/src/Options.cpp:13:
In static member function ‘static constexpr void std::char_traits<char>::assign(char_type&, const char_type&)’,
inlined from ‘void std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::push_back(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /home/don/gcc12/include/c++/12.2.0/bits/basic_string.h:1529:21,
inlined from ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /home/don/gcc12/include/c++/12.2.0/bits/basic_string.h:1351:17,
inlined from ‘void smf::Options::appendOptions(const std::string&)’ at BaconPlugs/libs/midifile/src/Options.cpp:880:26:
/home/don/gcc12/include/c++/12.2.0/bits/char_traits.h:354:14: warning: ‘ch’ may be used uninitialized [-Wmaybe-uninitialized]
354 | __c1 = __c2;
| ~~~~~^~~~~~
BaconPlugs/libs/midifile/src/Options.cpp: In member function ‘void smf::Options::appendOptions(const std::string&)’:
BaconPlugs/libs/midifile/src/Options.cpp:838:9: note: ‘ch’ was declared here
838 | char ch;
| ^~