Opened 9 years ago

Closed 9 years ago

#9854 closed Bugs (fixed)

boost_program_options.1.55.0.16\lib\native\src\value_semantic.cpp(271): warning C4127: conditional expression is constant

Reported by: nn1436401@… Owned by: Vladimir Prus
Milestone: To Be Determined Component: program_options
Version: Boost 1.55.0 Severity: Problem
Keywords: Cc:

Description

Instead of while(1) use for(;;)

void error_with_option_name::replace_token(const string& from, const string& to) const
    {
        while (1)
        {

Change History (5)

comment:1 by Vladimir Prus, 9 years ago

For the obvious fix like this, could you make a pull request on github? I think it has "Edit" button that would allow to create such request without any local work at all.

And, while we're at it, MSVC is not acting smart here ;-)

comment:2 by nn1436401@…, 9 years ago

I see fix here: github.com/boostorg/program_options/blob/develop/src/value_semantic.cpp#L271

What is the reason for not using 'for(;;)' and then there will be no need for #ifdef ?

comment:3 by Vladimir Prus, 9 years ago

#ifdefing while(1) does not seem reasonable, indeed.

comment:5 by Vladimir Prus, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.