Message ID | 599DB988.7040501@arm.com |
---|---|
State | New |
Headers | show |
On 23/08/17 18:21, Szabolcs Nagy wrote: > Use uint64_t instead of unsigned long. > > will commit it tomorrow if there are no objections. > > ChangleLog: > 2017-08-23 Szabolcs Nagy <szabolcs.nagy@arm.com> > > * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h (elf_greg_t): > Use uint64_t instead of unsigned long. > hm sys/procfs.h is included into signal.h via sys/ucontext.h, where stdint.h should not be exposed.. this does not happen in standards conforming mode, but happens with _DEFAULT_SOURCE==1 so it may cause problems. i'm not sure if this is ok or better use unsigned long long instead of uint64_t (preferred uint64_t to avoid changing the type on lp64)
On Tue, Aug 29, 2017 at 11:00 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote: > On 23/08/17 18:21, Szabolcs Nagy wrote: >> Use uint64_t instead of unsigned long. >> >> will commit it tomorrow if there are no objections. >> >> ChangleLog: >> 2017-08-23 Szabolcs Nagy <szabolcs.nagy@arm.com> >> >> * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h (elf_greg_t): >> Use uint64_t instead of unsigned long. >> > > hm sys/procfs.h is included into signal.h > via sys/ucontext.h, where stdint.h should > not be exposed.. sys/procfs.h already includes sys/types.h, so use __uint64_t. Why does sys/ucontext.h need to include sys/procfs.h? zw
On 29/08/17 16:20, Zack Weinberg wrote: > On Tue, Aug 29, 2017 at 11:00 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote: >> On 23/08/17 18:21, Szabolcs Nagy wrote: >>> Use uint64_t instead of unsigned long. >>> >>> will commit it tomorrow if there are no objections. >>> >>> ChangleLog: >>> 2017-08-23 Szabolcs Nagy <szabolcs.nagy@arm.com> >>> >>> * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h (elf_greg_t): >>> Use uint64_t instead of unsigned long. >>> >> >> hm sys/procfs.h is included into signal.h >> via sys/ucontext.h, where stdint.h should >> not be exposed.. > > sys/procfs.h already includes sys/types.h, so use __uint64_t. > ah thanks, that works. > Why does sys/ucontext.h need to include sys/procfs.h? > it defines elf_*_t which is used in ucontext.h as #ifdef __USE_MISC # include <sys/procfs.h> typedef elf_greg_t greg_t; /* Container for all general registers. */ typedef elf_gregset_t gregset_t; /* Structure to describe FPU registers. */ typedef elf_fpregset_t fpregset_t; #endif
diff --git a/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h b/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h index 7a7b1d0742..5c96bc5f17 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h +++ b/sysdeps/unix/sysv/linux/aarch64/sys/procfs.h @@ -32,11 +32,12 @@ #include <sys/time.h> #include <sys/types.h> #include <sys/user.h> +#include <stdint.h> __BEGIN_DECLS /* Type for a general-purpose register. */ -typedef unsigned long elf_greg_t; +typedef uint64_t elf_greg_t; /* And the whole bunch of them. We could have used `struct pt_regs' directly in the typedef, but tradition says that