Opened 13 years ago
Closed 13 years ago
#3171 closed Bugs (fixed)
'Conversion to int' warnings on VC++
| Reported by: | Jeremiah Willcock | Owned by: | Daniel James |
|---|---|---|---|
| Milestone: | Boost 1.40.0 | Component: | hash |
| Version: | Boost 1.39.0 | Severity: | Cosmetic |
| Keywords: | Cc: |
Description
The attached patch adds explicit static_casts to the calls to floating point functions to prevent warnings about converting floats to ints using implicit conversions.
Attachments (1)
Change History (5)
by , 13 years ago
| Attachment: | float_warnings.patch added |
|---|
comment:1 by , 13 years ago
comment:2 by , 13 years ago
I'm not using it at all -- the Boost regression tests are triggering this warning in several Boost.Graph files. One example is http://tinyurl.com/mgvn4z (ignore the later errors, I think they're unrelated). It looks like the only warnings here are from EVC++.
comment:3 by , 13 years ago
comment:4 by , 13 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
| Summary: | Adding explicit casts to prevent conversion warnings on VC++ → 'Conversion to int' warnings on VC++ |
The warning is no longer appearing in the trunk results. I'll merge to the release branch soon. Thanks for the report.
Note:
See TracTickets
for help on using tickets.

That looks wrong to me - if these functions aren't returning the same type as the function they call then something is wrong. That you're getting a
conversion to intwarning is odd sincetype1should always be a floating point type. Which version of Visual C++ are you using?