https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115185

--- Comment #17 from Alejandro Colomar <alx at kernel dot org> ---
(In reply to Sergei Trofimovich from comment #16)
> Sounds reasonable. Proposed possible changes upstream:
> - elfutils:
> https://patchwork.sourceware.org/project/elfutils/patch/20240715212340.

In the elfutils case:

diff --git a/backends/i386_regs.c b/backends/i386_regs.c
index 7ec93bb9..4bca1b1a 100644
--- a/backends/i386_regs.c
+++ b/backends/i386_regs.c
@@ -83,7 +83,7 @@  i386_register_info (Ebl *ebl __attribute__ ((unused)),

   switch (regno)
     {
-      static const char baseregs[][2] =
+      static const char baseregs[][3] =
        {
          "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip"
        };
diff --git a/backends/x86_64_regs.c b/backends/x86_64_regs.c
index ef987daf..c92c862a 100644
--- a/backends/x86_64_regs.c
+++ b/backends/x86_64_regs.c
@@ -80,7 +80,7 @@  x86_64_register_info (Ebl *ebl __attribute__ ((unused)),

   switch (regno)
     {
-      static const char baseregs[][2] =
+      static const char baseregs[][3] =
        {
          "ax", "dx", "cx", "bx", "si", "di", "bp", "sp"
        };


If you want to transform those into strings, I would use a size of 4, for
better alignment.  I didn't look into the code to know if it's valid, but I
assume that if 3 is valid, 4 also should be.

> 190915-1-sly...@gmail.com/
> - strace: https://github.com/strace/strace/pull/308

Reply via email to