This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] print format does not match argument type


Hi Patrick,

insight-owner@sourceware.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.

Roland



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]