Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning observed building Cardinal #105

Open
cosinekitty opened this issue Apr 1, 2024 · 0 comments
Open

Warning observed building Cardinal #105

cosinekitty opened this issue Apr 1, 2024 · 0 comments

Comments

@cosinekitty
Copy link
Collaborator

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;
      |         ^~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant