catchorg / Clara

A simple to use, composable, command line parser for C++ 11 and beyond
Boost Software License 1.0
649 stars 67 forks source link

Compilation warning: ‘flag’ may be used uninitialized #46

Closed aivarsk closed 6 years ago

aivarsk commented 6 years ago

Compilation produces following warning:

./third_party/clara/clara.hpp: In member function ‘virtual clara::detail::ParserResult clara::detail::BoundFlagRefBase::setValue(const string&)’:
./third_party/clara/clara.hpp:686:24: warning: ‘flag’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 setFlag( flag );
                 ~~~~~~~^~~~~~~~

I fixed it locally by initializing flag to false but there might be better ways to solve this.

philsquared commented 6 years ago

I believe the offending code was fixed in 8e664351ac51bdda881d531812119932df7c43ba (now part of v1.1.0), but then removed altogether in 5d21b7a2bf18e9e5ca97db42f71ef53bcaf13b2d. So I'm going to close this one now. Thanks for raising.