Bug 81329

Summary: casts from pointer to integer of different size or vice versa on 64 bit Windows (MinGW64 and MSVC)
Product: cairo Reporter: Peter Breitenlohner <peb>
Component: generalAssignee: Chris Wilson <chris>
Status: RESOLVED MOVED QA Contact: cairo-bugs mailing list <cairo-bugs>
Severity: normal    
Priority: medium    
Version: 1.12.16   
Hardware: x86-64 (AMD64)   
OS: Windows (All)   
Whiteboard:
i915 platform: i915 features:

Description Peter Breitenlohner 2014-07-14 08:14:05 UTC
There are several instance where a pointer is cast to 'unsigned long' or vice versa, e.g., in cairo-mempool.c and cairo-scaled-font.c.  On 64 bit Windows a pointer has 8 bytes whereas long has only 4 bytes.  This certainly causes compiler warnings and also might introduce bugs.

Ideally one should use uintptr_t instead of 'unsigned long' but that may not be present everywhere.  An alternative is to use 'unsigned __int64' if and only if _WIN64 is defined.
Comment 1 GitLab Migration User 2018-08-25 13:54:59 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/263.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.