Opened 7 years ago

Closed 5 years ago

#11616 closed Bugs (fixed)

Spirit unsigned to signed int comparison

Reported by: Duncan Paterson <duncan.paterson@…> Owned by: Joel de Guzman
Milestone: To Be Determined Component: spirit
Version: Boost 1.59.0 Severity: Cosmetic
Keywords: Cc:

Description

The following code generates warnings in with gcc (-Wall) and MSVC. The warnings reference signed to unsigned int comparison.

std::vector<float> values;
std::string line = "111.2, 222.0, 333.3, 444.6, 555.5";
bool r = phrase_parse(line.begin(), line.end(),
                     (float_ % ",")
                     ,space, values);

The warnings can be silenced by changing the problem variables from size_t to int as shown in the attached patch although I'm not sure this is an ideal solution.

Attachments (1)

intpatch.patch (1.7 KB ) - added by Duncan Paterson <duncan.paterson@…> 7 years ago.

Download all attachments as: .zip

Change History (3)

by Duncan Paterson <duncan.paterson@…>, 7 years ago

Attachment: intpatch.patch added

comment:1 by Nikita Kniazev <nok.raven@…>, 5 years ago

comment:2 by Joel de Guzman, 5 years ago

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