From: Tom de Vries Date: Mon, 13 Jul 2026 13:06:35 +0000 (+0200) Subject: [gdb] Use using in compat_x32_clock_t typedef X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2e06335b120ffee7664a65dde859d2bfa4e4358;p=thirdparty%2Fbinutils-gdb.git [gdb] Use using in compat_x32_clock_t typedef In commit 6c85ef111b0 ("[gdb] Use using instead of typedef"), I did: ... -typedef long __attribute__ ((__aligned__ (4))) compat_x32_clock_t; +using compat_x32_clock_t = long __attribute__ ((__aligned__ (4))); ... which I had to revert because clang ignores the attribute in this variant. Pedro suggested instead using: ... using compat_x32_clock_t [[gnu::aligned (4)]] = long; ... which does work with both clang and gcc. [ Note that it's not a question of how the attribute is worded, this also works: ... using compat_x32_clock_t __attribute__ ((__aligned__ (4))) = long; ... It's just a question of where the attribute is placed. ] Fix this by using Pedro's suggestion. Suggested-By: Pedro Alves Approved-By: Tom Tromey --- diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c index 99faccabf37..d524cb9f80a 100644 --- a/gdb/nat/amd64-linux-siginfo.c +++ b/gdb/nat/amd64-linux-siginfo.c @@ -203,7 +203,7 @@ struct compat_siginfo_t }; /* For x32, clock_t in _sigchld is 64bit aligned at 4 bytes. */ -typedef long __attribute__ ((__aligned__ (4))) compat_x32_clock_t; +using compat_x32_clock_t [[gnu::aligned (4)]] = long; struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo_t {