diff options
author | Roland McGrath <mcgrathr@google.com> | 2023-02-09 10:47:17 -0800 |
---|---|---|
committer | Roland McGrath <mcgrathr@google.com> | 2023-02-09 10:56:44 -0800 |
commit | b695fdd9b2494a64db1fb8e584753a1a5afec494 (patch) | |
tree | ac13742b6f413be19b12881413200e98880ad05b /gdb/aarch64-linux-nat.c | |
parent | 31cf28c7842497aa1f6472b7d76828cf009d2298 (diff) | |
download | gdb-b695fdd9b2494a64db1fb8e584753a1a5afec494.zip gdb-b695fdd9b2494a64db1fb8e584753a1a5afec494.tar.gz gdb-b695fdd9b2494a64db1fb8e584753a1a5afec494.tar.bz2 |
[aarch64] Avoid initializers for VLAs
Clang doesn't accept initializer syntax for variable-length
arrays in C. Just use memset instead.
Diffstat (limited to 'gdb/aarch64-linux-nat.c')
-rw-r--r-- | gdb/aarch64-linux-nat.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index e415823..ecb2eeb 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -56,6 +56,8 @@ #include "nat/aarch64-mte-linux-ptrace.h" +#include <string.h> + #ifndef TRAP_HWBKPT #define TRAP_HWBKPT 0x0004 #endif @@ -445,7 +447,9 @@ fetch_tlsregs_from_thread (struct regcache *regcache) gdb_assert (regno != -1); gdb_assert (tdep->tls_register_count > 0); - uint64_t tpidrs[tdep->tls_register_count] = { 0 }; + uint64_t tpidrs[tdep->tls_register_count]; + memset(tpidrs, 0, sizeof(tpidrs)); + struct iovec iovec; iovec.iov_base = tpidrs; iovec.iov_len = sizeof (tpidrs); @@ -471,7 +475,8 @@ store_tlsregs_to_thread (struct regcache *regcache) gdb_assert (regno != -1); gdb_assert (tdep->tls_register_count > 0); - uint64_t tpidrs[tdep->tls_register_count] = { 0 }; + uint64_t tpidrs[tdep->tls_register_count]; + memset(tpidrs, 0, sizeof(tpidrs)); for (int i = 0; i < tdep->tls_register_count; i++) { |