This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
RE: [PATCH] print format does not match argument type
- From: "Patrick Monnerat" <Patrick dot Monnerat at datasphere dot ch>
- To: <insight at sourceware dot org>
- Date: Tue, 10 Apr 2012 18:08:32 +0200
- Subject: RE: [PATCH] print format does not match argument type
- References: <4F8443D1.9080105@onevision.com>
Roland Schwingel wrote:
> The TYPE_FIELD_TYPE macro returns a pointer to a struct type.
> Treating this as (unsigned) long is pretty correct on *nix style
> systems but not on windows. On 64bit windows a long is still 4 bytes
> long, so the downcasted value is simply wrong.
I think I've found the universal (well: almost!) coding:
Use format "%llx" and cast arg to (unsigned long long): This is C99 and
supported by MSVC, at least since 2005. Not OK for C89 :-(
I hope it helps.
Patrick