Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb, gdb-18-branch] Ignore Wunused-function in gdb/ada-lex.l
Date: Fri, 20 Nov 2026 18:54:17 +0000	[thread overview]
Message-ID: <xhuyfpkvz2v1i.fsf@aburgess-thinkpadp1gen8.rmtgb.csb> (raw)
In-Reply-To: <20261120102232.894725-1-tdevries@suse.de>

Tom de Vries <tdevries@suse.de> writes:

> [ This patch is for the gdb-18-branch.  On trunk, commit 8b68f316801 ("Rewrite
> the Ada lexer") removes gdb/ada-lex.l, which also solves PR build/35015. ]
>
> In gdb/ada-lex.l, we have the following workaround:
> ...
>  /* Dummy definition to suppress warnings about unused static definitions. */
>  typedef void (*dummy_function) ();
>  dummy_function ada_flex_use[] =
>  {
>    (dummy_function) yyunput
>  };
> ...
>
> This stopped working for a range of flex versions (2.6.5 - 2.6.11) which
> define yyunput as a macro:
> ...
>  #define yyunput(c) yyunput_r(...)
> ...
>
> [ Version 2.6.12 restores the previous situation using commit 160a160
> ("fix(skel): restore the flex 2.6.4 yyunput function"). ]
>
> I ran into this on cygwin using 2.6.11.
>
> We can fix this using:
> ...
>  #ifdef yyunput
>    (dummy_function) yyunput_r
>  #else
>    (dummy_function) yyunput
>  #endif
> ...
> but that seems fragile.
>
> We could use "%option nounput".  It was added in 2.5.1, but with some bug that
> was fixed in 2.5.2.  For gdb-18-branch, we (de facto) require >= 2.5.1, and
> using "%option nounput" would break support for 2.5.1.
>
> We could use YY_NO_YYUNPUT (available starting 2.6.5) to suppress the
> generation of yyunput, while falling back to ada_flex_use for < 2.6.5.
> A patch was submitted using this approach [1].
>
> Instead, fix this using a simpler approach: drop ada_flex_use, and ignore the
> resulting warning.

If this is only for gdb-18-branch and not for master, then I think this
is fine.

Approved-By: Andrew Burgess <aburgess@redhat.com>

Thanks,
Andrew


      reply	other threads:[~2026-11-20 18:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-20 10:22 Tom de Vries
2026-11-20 18:54 ` Andrew Burgess [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xhuyfpkvz2v1i.fsf@aburgess-thinkpadp1gen8.rmtgb.csb \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox