From: Ian Scott <ian.scott@st...> - 2002-11-11 13:56:40
The warnings are with implicit casts- I'm assuming that an explicit cast
would get rid of the warning as it does in most cases of integer truncation.
That still soen not make it correct. Tim and I are concerned about dealing
with in memory images larger that 4Gb, on some future platform with
sizeof(int) == 4 and sizeof(void *)== 8. We will have real problems keeping
things like vil2_image_view<T>::planestep_ as an integer. Its correct type
is really ptrdiff_t.
However, on such a platform I also need to be able to do vsl_b_write(os,
ptrdiff_t(a)) correctly. This means that the value stays as a ptrdiff_t
> -----Original Message-----
> From: Andrew Fitzgibbon [mailto:awf@...]
> Sent: Monday, November 11, 2002 12:26 PM
> To: Ian Scott; 'Amitha Perera (E-mail)'
> Subject: RE: [Vxl-maintainers] MSVC7.0 doesn't appear to know
> what type
> ptrdiff_t really is.
> Is this with implicit or explicit casts? Do we need to try to
> keep arithmetic in terms of ptrdiff_t for longer?
Concerning the ptrdiff_t warnings with VC 7: I just committed a change
that should fix the warnings.
I didn't want to globally disable the warning, because it is a useful
warning to have, and I didn't want to disable it in the
vsl_binary_io.h header, because that will "infect" whoever includes
So, I put in the "__w64" keyword, which essentially tells the compiler
that there won't be any 32-bit to 64-bit conversions issues for a
specific type. (Actually, ptrdiff_t is defined as "int __w64", so I
just changed the parameter to match. Since int "converts" without
warning to "int __w6", all is well.)
On a real 64-bit platform, the warnings will trigger again, as they
should: there isn't any code (yet) to write out 64-bit
integers. 64-bit Windows (WIN64) has int and long at 32-bits, and
__Int64 as the 64-bit integral type.
FWIW, we could probably write the 64-bit binary code by using the