This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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 v2 2/2] ari, btrace: avoid unsigned long long


> -----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


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