Opened 8 years ago

Closed 8 years ago

#10098 closed Patches (fixed)

Ugly warning about sign/unsigned mismatch in comparison

Reported by: Joseph Southwell <joseph@…> Owned by: Neil Groves
Milestone: Boost 1.56.0 Component: range
Version: Boost Release Branch Severity: Cosmetic
Keywords: Cc:

Description

operator[] and operator() in iterator_range_core take difference_type and then compare it to size type. To fix the warning either those operators should take size_type or you should cast at like ((size_type)at) in the comparison.

I am attaching a patch with cast option in it since that is less likely to impact things calling these operators.

Attachments (1)

sign_mismatch.patch (1.5 KB ) - added by Joseph Southwell <joseph@…> 8 years ago.
patch with one way to fix this warning.

Download all attachments as: .zip

Change History (5)

by Joseph Southwell <joseph@…>, 8 years ago

Attachment: sign_mismatch.patch added

patch with one way to fix this warning.

comment:1 by Joseph Southwell <joseph@…>, 8 years ago

Oh, I should mention that the warning is pages long on visual studio. I am betting it is a one liner on whatever compiler you are using most.

Maybe you have a better way to fix this. I don't know. I am just trying to be helpful.

comment:2 by Neil Groves, 8 years ago

Milestone: To Be DeterminedBoost 1.56.0
Status: newassigned

Yep I'll fix this in the next couple of days. I won't use a C style cast though. I'll update the trac ticket once I am done. It'll be put onto the develop branch first while I wait for tests to cycle before promotion to master.

comment:3 by Neil Groves, 8 years ago

Fixed on the develop branch. Waiting for test results before merging to master.

comment:4 by Neil Groves, 8 years ago

Resolution: fixed
Status: assignedclosed

Now merged to master ready for release 1.56

Note: See TracTickets for help on using tickets.