2016.11.17 03:33 "[Tiff] Visual Studio Warnings", by Aaron Boxer

2016.11.17 16:07 "Re: [Tiff] Visual Studio Warnings", by Aaron Boxer

Thanks, Bob. Yes, 64 bit build. And yes, cast to size_t does fix the warning.

Aaron

On Thu, Nov 17, 2016 at 9:41 AM, Bob Friesenhahn < bfriesen@simple.dallas.tx.us> wrote:

I assume that this was for a 64-bit build. Most of these warnings look suspect to me. Anything involving computation of a pointer address deserves close attention.

Please check if adding (size_t) to the shifted value like

   m = img->UaToAa+((size_t) a2<<8);

makes the warning go away for 32 and 64-bit builds.

The libtiff release is still "pending" but if all goes well I expect that it will no longer be pending as of Saturday the 19th.

Bob

On Wed, 16 Nov 2016, Aaron Boxer wrote:

> FYI:

libtiff\tif_win32.c(242): warning C4312: 'type cast': conversion from 'int' to 'thandle_t' of greater size \libtiff\tif_win32.c(287): warning C4311: 'type cast': pointer truncation from 'thandle_t' to 'int' \libtiff\tif_win32.c(342): warning C4311: 'type cast': pointer truncation from 'thandle_t' to 'int' \libtiff\tif_dirinfo.c(724): warning C6031: Return value ignored: 'snprintf'.

\libtiff\tif_getimage.c(1443): warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value. \libtiff\tif_getimage.c(1514): warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value. \libtiff\tif_getimage.c(1645): warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value. \libtiff\tif_getimage.c(1711): warning C6297: Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value.

The first three already have a FIXME comment.

I doubt these cause actual bugs, but always to be warning-free.