Re: [PATCH] gdb: fix command_classes name clash

Tom de Vries
2025-11-06T15:29:26Z

On 11/5/25 11:59 PM, simon.marchi@polymtl.ca wrote:
> From: Simon Marchi <simon.marchi@polymtl.ca>
>
> I currently see this build failure:
>
> CXX guile/scm-cmd.o
> /home/simark/src/binutils-gdb/gdb/guile/scm-cmd.c:551:54: error: ‘const scheme_integer_constant command_classes []’ redeclared as different kind of entity
> 551 | static const scheme_integer_constant command_classes[] =
> | ^
> In file included from /home/simark/src/binutils-gdb/gdb/defs.h:63,
> from <command-line>:
> /home/simark/src/binutils-gdb/gdb/command.h:71:42: note: previous declaration ‘using command_classes = class enum_flags<command_class>’
> 71 | DEF_ENUM_FLAGS_TYPE (enum command_class, command_classes);
> | ^~~~~~~~~~~~~~~
> /home/simark/src/binutils-gdb/gdb/../gdbsupport/enum-flags.h:58:9: note: in definition of macro ‘DEF_ENUM_FLAGS_TYPE’
> 58 | using flags_type = enum_flags<enum_type>; \
> | ^~~~~~~~~~
>
> This looks like an unfortunate name clash. Fix it by renaming the
> variable in scm-cmd.c.

Hi Simon,

I also ran into this problem, thanks for fixing this.

The fix looks trivial enough, and I managed to build gdb and run the
testsuite past gdb.guile without any fallout, so LGTM, please apply.

Approved-By: Tom de Vries <tdevries@suse.de>

Thanks,
- Tom