Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH v2 04/19] gdb: remove YY_NULL to YY_NULLPTR substitution
Date: Sat,  5 Sep 2026 00:23:07 -0400	[thread overview]
Message-ID: <20260905042353.1702204-5-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20260905042353.1702204-1-simon.marchi@polymtl.ca>

From: Simon Marchi <simon.marchi@polymtl.ca>

The rule generating parsers from .y files substitutes YY_NULL with
YY_NULLPTR.  It was introduced by commit 722bcb33bf03 ("Replace YY_NULL with
YY_NULLPTR in LANG-exp.c", 2016-11-03), to fix a build failure with bison
2.6.4 (anything older than 3.0.2).  This version emitted the macro:

  #define YY_NULL nullptr

while flex emitted:

  #define YY_NULL 0

Bison 3.0.2 started to use the name YY_NULLPTR instead, and the
substitution was us doing the same thing by hand, to circumvent the problem
when using older versions.

I think it is safe to assume that no GDB developer uses a > 13 year old
Bison, so we can remove this substitution.

Change-Id: I518dbb1794c9bdd8b016046639697e31168a9282
---
 gdb/Makefile.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index aeafb9394d7b..dec887ff6095 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2705,7 +2705,6 @@ po/$(PACKAGE).pot: force
 	     -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
 	     -e 's/\([ \t;,(]\)free$$/\1xfree/g' \
 	     -e '/^#line.*y.tab.c/d' \
-	     -e 's/YY_NULL/YY_NULLPTR/g' \
 	     -e "s/YYSTYPE/$(subst -,_,$*)_YYSTYPE/g" \
 	     -e "s/yyalloc/$(subst -,_,$*)_yyalloc/g" \
 	     -e "s/yysymbol_kind_t/$(subst -,_,$*)_yysymbol_kind_t/g" \
-- 
2.55.0


  parent reply	other threads:[~2026-09-05  4:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05  4:23 [PATCH v2 00/19] Move C++ support code out of .y files simon.marchi
2026-09-05  4:23 ` [PATCH v2 01/19] gdb/ada-exp-parser: remove name_info struct simon.marchi
2026-09-05  4:23 ` [PATCH v2 02/19] gdb: replace parse_type macros with functions simon.marchi
2026-09-05  4:23 ` [PATCH v2 03/19] gdb: suffix flex/bison output files with -gen.c simon.marchi
2026-09-05  4:23 ` simon.marchi [this message]
2026-09-05  4:23 ` [PATCH v2 05/19] gdb: move parser output post-processing to a script simon.marchi
2026-09-05  4:23 ` [PATCH v2 06/19] gdb: let the parser and lexer generators prefix their symbols simon.marchi
2026-09-05  4:23 ` [PATCH v2 07/19] gdb: separate cp-name-parser's symbol prefix with an underscore simon.marchi
2026-09-05  4:23 ` [PATCH v2 08/19] gdb: make $(YACC) and $(FLEX) generate headers simon.marchi
2026-09-05  4:23 ` [PATCH v2 09/19] gdb: add check for stale build generated files simon.marchi
2026-09-05  4:23 ` [PATCH v2 10/19] gdb: move cp-name-parser.y's support code to cp-name-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 11/19] gdb: rename LANG-exp.y to LANG-exp-parser.y simon.marchi
2026-09-05  4:23 ` [PATCH v2 12/19] gdb: move c-exp-parser.y's support code to c-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 13/19] gdb: move ada-exp-parser.y's support code to ada-exp-parser.c simon.marchi
2026-09-08 18:28   ` Kevin Buettner
2026-09-05  4:23 ` [PATCH v2 14/19] gdb: move d-exp-parser.y's support code to d-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 15/19] gdb: move f-exp-parser.y's support code to f-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 16/19] gdb: move go-exp-parser.y's support code to go-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 17/19] gdb: move m2-exp-parser.y's support code to m2-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 18/19] gdb: move p-exp-parser.y's support code to p-exp-parser.c simon.marchi
2026-09-05  4:23 ` [PATCH v2 19/19] gdb: honor "set debug parser" in the Modula-2 and Pascal parsers simon.marchi

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=20260905042353.1702204-5-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox