On Thu, 18 Jul 2024 18:49:54 +0200 Mark Wielaard <m...@klomp.org> wrote:
> Hi Sergei, > > On Wed, 2024-07-17 at 23:03 +0100, Sergei Trofimovich wrote: > > `gcc-15` added a new warning in https://gcc.gnu.org/PR115185: > > > > i386_regs.c:88:11: error: initializer-string for array of 'char' is too > > long [-Werror=unterminated-string-initialization] > > 88 | "ax", "cx", "dx", "bx", "sp", "bp", "si", "di", "ip" > > | ^~~~ > > > > `elfutils` does not need to store '\0'. We could either initialize the > > arrays with individual bytes or allocate extra byte for null. > > > > This change initializes the array bytewise. > > > > * backends/i386_regs.c (i386_register_info): Initialize the > > array bytewise to fix gcc-15 warning. > > * backends/x86_64_regs.c (x86_64_register_info): Ditto. > > This looks good. I have pushed it to main. > > Will this warning be enabled by -Wall or -Wextra (both of which are > enabled by default for elfutils builds)? Or would be need to enable it > explicitly? Thank you! It's enabled only with `-Wextra` (and that's how I encountered on build failure in `elfutils`). -- Sergei