Opened 8 years ago
Closed 8 years ago
#10098 closed Patches (fixed)
Ugly warning about sign/unsigned mismatch in comparison
Reported by: | 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)
Change History (5)
by , 8 years ago
Attachment: | sign_mismatch.patch added |
---|
comment:1 by , 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 , 8 years ago
Milestone: | To Be Determined → Boost 1.56.0 |
---|---|
Status: | new → assigned |
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 , 8 years ago
Fixed on the develop branch. Waiting for test results before merging to master.
comment:4 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Now merged to master ready for release 1.56
patch with one way to fix this warning.