Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#8402 closed Support Requests (fixed)

x64 compiler warning C4244: conversion from 'unsigned __int64' to 'int', possible loss of data

Reported by: Volker Schöch <vschoech@…> Owned by: Barend Gehrels
Milestone: Boost 1.57.0 Component: geometry
Version: Boost 1.52.0 Severity: Cosmetic
Keywords: x64, VC++ 2012, warning, C4244, conversion from 'unsigned __int64' to 'int' Cc:

Description

I'm using Microsoft Visual Studio 2012 to compile boost 1.52.0 in an x64 project. I use compiter flag /W4. In this situation, some implicit casts in geometry trigger compiler warnings (which we declared errors for our project), because some numeric data types that match in x86 have different widths in x64:

\boost_1_52_0\boost\geometry\io\wkt\read.hpp(514): error C4244: 'initializing' : conversion from 'unsigned __int64' to 'int', possible loss of data int n = boost::size(points);
\boost_1_52_0\boost\geometry\algorithms\detail\overlay\follow.hpp(395): error C4244: 'argument' : conversion from 'unsigned __int64' to 'int', possible loss of data geometry::copy_segments<false>(linestring, current_segment_id, boost::size(linestring) - 1, current_piece);

Maybe it's possible to eliminate those warnings for the next boost version?

Change History (4)

comment:1 by Volker Schöch <vschoech@…>, 10 years ago

Sorry, I mixed the code with the message. Unfortunately I cannot edit the original post, so here are the messages with the correct line breaks:

\boost_1_52_0\boost\geometry\io\wkt\read.hpp(514): error C4244: 'initializing' : conversion from 'unsigned __int64' to 'int', possible loss of data
int n = boost::size(points);
\boost_1_52_0\boost\geometry\algorithms\detail\overlay\follow.hpp(395): error C4244: 'argument' : conversion from 'unsigned __int64' to 'int', possible loss of data
geometry::copy_segments<false>(linestring, current_segment_id, boost::size(linestring) - 1, current_piece);

comment:2 by Barend Gehrels, 10 years ago

Severity: ProblemCosmetic
Type: BugsSupport Requests

comment:3 by awulkiew, 8 years ago

Milestone: To Be DeterminedBoost 1.57.0
Resolution: fixed
Status: newclosed

comment:4 by Volker Schöch <vschoech@…>, 8 years ago

Please consider related Ticket #10667.

Note: See TracTickets for help on using tickets.