This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [PATCH v2 2/2] ari, btrace: avoid unsigned long long
- From: "Metzger, Markus T" <markus dot t dot metzger at intel dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Fri, 10 Jul 2015 07:16:36 +0000
- Subject: RE: [PATCH v2 2/2] ari, btrace: avoid unsigned long long
- Authentication-results: sourceware.org; auth=none
- References: <1436422132-8936-1-git-send-email-markus dot t dot metzger at intel dot com> <1436422132-8936-2-git-send-email-markus dot t dot metzger at intel dot com> <559E57C0 dot 90006 at redhat dot com>
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Thursday, July 9, 2015 1:15 PM
> To: Metzger, Markus T
> Cc: gdb-patches@sourceware.org
> Subject: Re: [PATCH v2 2/2] ari, btrace: avoid unsigned long long
>
> On 07/09/2015 07:08 AM, Markus Metzger wrote:
> > 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.
>
> But, what exactly would break?
I changed the commit message to this:
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_evene.h as __u64) in a ULONGEST * variable.
Use unsigned long to hold the buffer size inside GDB and __u64 when
interfacing the kernel.
Is that OK?
> > Use unsigned long to hold
> > the buffer size inside GDB
>
> Why not use size_t instead then?
It's another typedef. And without a clearly defined size.
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