This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH/RFC] gag some compiler warnings
- From: Mark Kettenis <kettenis at chello dot nl>
- To: Elena Zannoni <ezannoni at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: 03 Jul 2003 22:49:23 +0200
- Subject: Re: [PATCH/RFC] gag some compiler warnings
- References: <16132.24210.943200.572653@localhost.redhat.com>
Elena Zannoni <ezannoni@redhat.com> writes:
> I am seeing these on a 64 bit system, when building gdb in 32-bit mode:
>
> /home/cygnus/ezannoni/gdb-6/src/gdb/infptrace.c: In function `child_xfer_memory':
> /home/cygnus/ezannoni/gdb-6/src/gdb/infptrace.c:570: warning: cast to pointer from integer of different size
>
> The problem is that we pass a CORE_ADDR (which is 8 bytes long) to
> ptrace and we cast it to PTRACE_ARG3_TYPE (which is 4 bytes long).
>
> Is this ok? Not too pretty, I know.
> * infptrace.c (child_xfer_memory): Cast ptrace argument to long,
> for cases in which CORE_ADDR size and pointer size don't agree.
Hmm. I don't think this is OK. This could easily hide genuine
problems. What system is this? Or perhaps a better question: what is
the prototype of ptrace() in 32-bit mode on this system, and what is
your definition of PTRACE_ARG3_TYPE on this system?
Mark