On Thu, Oct 08, 2020 at 12:09:15PM -0500, Eric Blake wrote: > On 10/8/20 11:18 AM, Peter Maydell wrote: > > > > > Compile failure, windows crossbuilds: > > > > ../../migration/migration.c: In function 'page_request_addr_cmp': > > ../../migration/migration.c:148:23: error: cast from pointer to > > integer of different size [-Werror=pointer-to-int-cast] > > unsigned long a = (unsigned long) ap, b = (unsigned long) bp; > > ^ > > 'unsigned long' is platform specific; so is uintptr_t, but it may fit > more naturally. Or maybe you are better off with a specific 32- or > 64-bit type, but even so, may need a double cast (first to uintptr_t > then to your real target) to shut up warnings?
Sorry for that. When I was initially trying to fix the 32bit build failure I did use double cast, but I (obviously, wrongly) thought sizeof(unsigned long) should always be the same size as sizeof(void *), so I explicitly removed that, since at least my 32bit compile didn't complaint. But obviously Windows/mingw is probably different on that.. I'll find a mingw environment soon and verify. It would take some more time after docker stopped to work on my current host due to cgroup versions, however shouldn't be long. Thanks, -- Peter Xu