http://lists.freedesktop.org/archives/dbus/2012-December/015378.html mentions a compiler warning in windows, which should be fixed.
Sure, I'd review a patch. Dropping the severity, though - in general mixing up %d vs. %ld is a significant bug (32- vs. 64-bit on most 64-bit Unixes), but as far as I understand it, there is no significant Windows platform where sizeof(int) != sizeof(long).
Created attachment 83812 [details] [review] Fixed compile warning
Am I right in thinking that DWORD is always "unsigned long", even on 64-bit Windows? If it is, then surely it should be ..."error=%lu", GetLastError() or something?
(I wish I could tell you "use the Windows DWORD equivalent of GLib's G_SIZE_FORMAT" but it doesn't seem to have one...)
(In reply to comment #3) > Am I right in thinking that DWORD is always "unsigned long", even on 64-bit > Windows? > > If it is, then surely it should be > > ..."error=%lu", GetLastError() > > or something? seems not windef.h ... typedef unsigned __LONG32 DWORD; _mingw.h /* Target specific macro replacement for type "long". In the Windows API, the type long is always 32 bit, even if the target is 64 bit (LLP64). On 64 bit Cygwin, the type long is 64 bit (LP64). So, to get the right sized definitions and declarations, all usage of type long in the Windows headers have to be replaced by the below defined macro __LONG32. */ #ifndef __LP64__ /* 32 bit target, 64 bit Mingw target */ #define __LONG32 long #else /* 64 bit Cygwin target */ #define __LONG32 int #endif
Ugh, I hadn't realised Cygwin had a different size model. In that case I'd vaguely prefer: "... %lu", (unsigned long) GetLastError() since that cast will definitely not truncate... I suppose the actual error codes can't go beyond 32-bit, so if you'd prefer "... %u", (unsigned) GetLastError() that would be OK too. Using (signed) int as in your current patch doesn't seem right to me, since DWORD is an unsigned type, but I suppose it's probably OK in practice.
Created attachment 83976 [details] [review] Fixed warning (update)
The format string for "(unsigned)" is %u, not %d.
Created attachment 84236 [details] [review] Fixed warning (update2)
Comment on attachment 84236 [details] [review] Fixed warning (update2) Review of attachment 84236 [details] [review]: ----------------------------------------------------------------- Ship it
(In reply to comment #10) > > Ship it committed
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.