AWARE [SYSTEMS]
AWare Systems, , Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
December 2018

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
Archive maintained by AWare Systems



New Datamatrix section



Valid HTML 4.01!



Thread

2018.12.03 04:19 "WIN64 : cast to or from pointer warning", by Vincent Torri
2018.12.03 14:29 "Re: WIN64 : cast to or from pointer warning", by Bob Friesenhahn
2018.12.04 10:43 "Re: WIN64 : cast to or from pointer warning", by Vincent Torri
2018.12.04 11:42 "Re: WIN64 : cast to or from pointer warning", by Roger Leigh
2018.12.04 13:36 "Re: WIN64 : cast to or from pointer warning", by Bob Friesenhahn

2018.12.03 14:29 "Re: WIN64 : cast to or from pointer warning", by Bob Friesenhahn

On Mon, 3 Dec 2018, Vincent Torri wrote:

> Hello
>
> in tif_win32.c there are 3 warnings about conversion to or from a pointer
>
> usually, a way to fix this is to cast uintptr_t or intptr_t :
>
> 1)
> tif = TIFFClientOpen(name, mode, (thandle_t)ifd, /* FIXME: WIN64 cast
> to pointer warning */

This is a long-standing issue.  Unfortunately, applying a cast does 
not solve the underlying problem that the required storage type does 
not fit in the size which is actually passed.

Fixing the problem requires changing the involved ABI (impacting using 
applications) since either a pointer needs to be passed, or a larger 
storage type needs to be used.

Thus far it seems that Windows only uses the lower range of its handle 
type.

An alternative is to use tif_unix.c.

> Also, in iptcutil.c there is the same kind of warnings because cast to
> long are done, but on WIN64 long has a size of 4 bytes, not 8. Use
> ptrdiff_t instead of long in that case as you are doing pointer
> arithmetic

Please send us a source patch for this.

Bob
-- 
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt
_______________________________________________
Tiff mailing list
Tiff@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/tiff