Re: GDB 13.1 and clang

Andrew Pinski via Gdb
2023-03-08T20:17:31Z

On Wed, Mar 8, 2023 at 12:07 PM Chris Johns <chrisj@rtems.org> wrote:
>
> Hi,
>
> I have just tried to build the latest RTEMS tools and we now use gdb 13.1. I am
> seeing a build failure on FreeBSD 13.1 of:
>
> In file included from ../../gdb-13.1/gdb/xml-tdesc.c:23:
> In file included from ../../gdb-13.1/gdb/target.h:42:
> In file included from ../../gdb-13.1/gdb/infrun.h:21:
> In file included from ../../gdb-13.1/gdb/gdbthread.h:26:
> In file included from ../../gdb-13.1/gdb/breakpoint.h:38:
> ../../gdb-13.1/gdb/target/waitstatus.h:113:1: error: use of undeclared
> identifier 'DIAGNOSTIC_ERROR_SWITCH'
> DIAGNOSTIC_ERROR_SWITCH
> ^
>
> I only have clang installed on the FreeBSD machine.
>
> A quick review of include/diagnostics.h seems to show support for
> DIAGNOSTIC_ERROR_SWITCH only in the gcc area?

Huh? I looked into include/diagnostics.h in git and there is even:
#ifndef DIAGNOSTIC_ERROR_SWITCH
# define DIAGNOSTIC_ERROR_SWITCH
#endif

And before under `#if defined (__clang__) /* clang */`
# define DIAGNOSTIC_ERROR_SWITCH \
DIAGNOSTIC_ERROR ("-Wswitch")

So I have no idea how it would be broken.
Unless somehow the wrong diagnostics.h is getting included. As far as
I can see include/diagnostics.h is the only one in git even.

Thanks,
Andrew Pinski

>
> Is this something I should raise a ticket for?
>
> Thanks
> Chris