This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH v3] ari, btrace: avoid unsigned long long
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: "palves at redhat dot com" <palves at redhat dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Tue, 14 Jul 2015 06:27:03 +0000
- Subject: RE: [PATCH v3] ari, btrace: avoid unsigned long long
- Authentication-results: sourceware.org; auth=none
- References: <1436798835-13022-1-git-send-email-markus dot t dot metzger at intel dot com> <201507131536 dot t6DFaPmx009653 at glazunov dot sibelius dot xs4all dot nl>
> -----Original Message-----
> From: Mark Kettenis [mailto:mark.kettenis@xs4all.nl]
> Sent: Monday, July 13, 2015 5:36 PM
> To: Metzger, Markus T
> Cc: palves@redhat.com; gdb-patches@sourceware.org
> Subject: Re: [PATCH v3] ari, btrace: avoid unsigned long long
Hello Mark,
> > Fix the ARI warning about the use of unsigned long long. We can't use
> > ULONGEST as this is defined unsigned long on 64-bit systems. This will
> > result in a compile error when storing a pointer to an unsigned long long
> > structure field (declared in perf_event.h as __u64) in a ULONGEST *
> variable.
> >
> > Use size_t to hold the buffer size inside GDB and __u64 when interfacing
> the
> > Linux kernel.
>
> Please don't propagate the use of Linux kernel types outside of the
> linux kernel. The ISO C spelling of __u64 is uint64_t.
I restrict the use of __u64 to the lowest layer that deals with the kernel
interface. Higher layers use GDB types.
The problem is that on 64-bit systems __u64 is defined unsigned long long,
whereas uint64_t is defined unsigned long. GCC complains when I store
the address of a __u64 variable in a uint64_t * variable.
Regards,
Markus.
Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Prof. Dr. Hermann Eul
Chairperson of the Supervisory Board: Tiffany Doon Silva
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928