This is the mail archive of the
mailing list for the Insight project.
Re: [PATCH] print format does not match argument type
- From: Roland Schwingel <roland at onevision dot com>
- To: insight at sourceware dot org, Patrick dot Monnerat at datasphere dot ch
- Date: Tue, 10 Apr 2012 16:29:37 +0200
- Subject: Re: [PATCH] print format does not match argument type
firstname.lastname@example.org wrote on 05.04.2012 18:34:27:
> In gdb/gdbtk/generic/gdbtk-register.c, 2 statements try to use a print
> format of "%lx" for a size_t argument. The correctness of such
> statements is architecture dependent. If warnings are treated as
> errors,the compilation fails.
Which warnings do you get on which platform?
The casts to size_t where introduced by myself some days ago.
Previously they where casted to long.
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.