Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#11645 closed Bugs (fixed)

basic_option::basic_option(2) misses initialization for position_key

Reported by: bernd.loerwald@… Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description

The basic_option(const std::string& xstring_key, const std::vector< std::string> &xvalue) overload in option.hpp:31 does not initialize the position_key member, while the default ctor does.

When having an extra_style_parser and positional options the options that were removed by the extra_style_parser are considered positional, unless the extra_style_parser explicitely sets position_key = -1.

Change History (3)

comment:1 by Vladimir Prus, 7 years ago

Resolution: fixed
Status: newclosed

Thanks for the report, this issue is not fixed in develop. Could you check again please?

comment:2 by anonymous, 7 years ago

Exactly as expected. Wonderful. Thanks for the fast fix. :)

Was there no compiler warning, though? That seems like something trivial to detect.

comment:3 by Vladimir Prus, 7 years ago

I don't think there were a compiler warning at the normal warning level. I've just tried with VS /W4, and it does not seem to warn either (while producing a pile of spurious warnings).

Note: See TracTickets for help on using tickets.