From: Phil Sutter <phil@nwl.cc>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org,
"Jan Kończak" <jan.konczak@cs.put.poznan.pl>
Subject: Re: [nft PATCH v2] parser_bison: Fix for bison < 3.6
Date: Thu, 23 Jul 2026 12:09:14 +0200 [thread overview]
Message-ID: <amHoSglXwfNia7V7@orbyte.nwl.cc> (raw)
In-Reply-To: <20260611125231.652353-1-phil@nwl.cc>
On Thu, Jun 11, 2026 at 02:52:25PM +0200, Phil Sutter wrote:
> Support for 'custom' parse.error value was added in bison-3.6. Fall back
> to previous value for earlier versions.
>
> This is harder to get right than it seems: On one hand, preprocessor
> macros can't be used in parser_bison.y's declaration section and
> automake forbids conditional changes to AM_YFLAGS on the other.
>
> Another aspect complicating things is compiling with (an up to date)
> parser_bison.c in place vs. without: Dist tarballs generally have it in
> place, relieving users from having to provide a YACC when compiling. The
> existing parser_bison.c either uses parse.error=custom or not which does
> not (should not) change when compiling. Hiding yyreport_syntax_error()
> behind a CPPFLAG which may be set or not depending on bison presence and
> version then causes trouble if it doesn't match how parser_bison.c was
> created.
>
> Avoid these pitfalls by:
> - Not relying upon a preprocessor define to control parser_bison.c
> compilation, instead check existence of the bison-internal
> YY_LAC_ESTABLISH macro
> - Exporting the above macro existence check in a variable for use by
> main.c (thereby crossing the libnftables library boundary)
>
> Also:
> - Introduce have_prebuilt_bison variable in configure.ac, unifying the
> parser_bison.c existence check and solidify the latter by also
> comparing its timestamp
> - Report extended parser errors enableval in configure only if
> parser_bison.c will be recreated, otherwise we can't quite tell if it
> will turn out to be enabled or not
>
> Suggested-by: Jan Kończak <jan.konczak@cs.put.poznan.pl>
> Fixes: 67b822f2b2624 ("parser_bison: on syntax errors, output expected tokens")
> Signed-off-by: Phil Sutter <phil@nwl.cc>
Patch applied.
prev parent reply other threads:[~2026-07-23 10:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-11 12:52 [nft PATCH v2] parser_bison: Fix for bison < 3.6 Phil Sutter
2026-07-23 10:09 ` Phil Sutter [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=amHoSglXwfNia7V7@orbyte.nwl.cc \
--to=phil@nwl.cc \
--cc=jan.konczak@cs.put.poznan.pl \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.