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)

float_warnings.patch (2.0 KB ) - added by Jeremiah Willcock 13 years ago.

Download all attachments as: .zip

Change History (5)

by Jeremiah Willcock, 13 years ago

Attachment: float_warnings.patch added

comment:1 by Daniel James, 13 years ago

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 int warning is odd since type1 should always be a floating point type. Which version of Visual C++ are you using?

comment:2 by Jeremiah Willcock, 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 Daniel James, 13 years ago

(In [53828]) Try to avoid float to int warning when a float function doesn't exist. Refs #3171.

comment:4 by Daniel James, 13 years ago

Resolution: fixed
Status: newclosed
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.