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 v3] ari, btrace: avoid unsigned long long


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


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