id summary reporter owner description type status milestone component version severity resolution keywords cc 990 spirit's file_iterator truncates file size value on Windows x64 (VC8.0express) peter.myerscough-jackopson@… Hartmut Kaiser "I have written a grammar to read in a file. I am using spirit's file_iterator class to enable the parse(...) function to read directly from the file and I get the following warning: {{{ 1> XXX\boost\boost_1_34_0\boost/spirit/iterator/impl/file_iterator.ipp(276) : warning C4244: 'return' : conversion from '__w64 int' to 'long', possible loss of data 1> XXX\boost\boost_1_34_0\boost/spirit/iterator/impl/file_iterator.ipp(276) : while compiling class template member function 'long boost::spirit::fileiter_impl::mmap_file_iterator::distance(const boost::spirit::fileiter_impl::mmap_file_iterator &) const' 1> with 1> [ 1> CharT=char 1> ] 1> XXX\boost\boost_1_34_0\boost/spirit/iterator/file_iterator.hpp(118) : see reference to class template instantiation 'boost::spirit::fileiter_impl::mmap_file_iterator' being compiled 1> with 1> [ 1> CharT=char 1> ] 1> XXX\boost\boost_1_34_0\boost/spirit/iterator/file_iterator.hpp(152) : see reference to class template instantiation 'boost::spirit::fileiter_impl::file_iter_generator' being compiled 1> with 1> [ 1> CharT=char, 1> BaseIteratorT=boost::spirit::fileiter_impl::mmap_file_iterator 1> ] 1> .\myfile.cpp(121) : see reference to class template instantiation 'boost::spirit::file_iterator<>' being compiled }}} This would be a problem for me if my file's were large, but they are not. Essentially in the file_iterator.ipp function the [[BR]] ''long distance(const mmap_file_iterator& iter) const''[[BR]] is wrong as the difference between pointers on a 64bit windows computer is not a long. I think this needs to change to:[[BR]] ''ptrdiff_t distance(const mmap_file_iterator& iter) const''[[BR]] I have tried this in my copy of the file, but the warning moves to the files/classes that use the function. I am also not sure about the other considerations for this function's return type, so I haven't proposed a patch. I am compiling on Windows XP Pro x64, using MSVC++ 8.0 express edition (with SP1) on Xeon CPUs. I'm pretty sure the problem was also present without SP1." Bugs closed Boost 1.34.1 spirit Boost 1.34.0 Problem fixed file_iterator spirit x64 windows 64bit