diff options
author | dholland <dholland@pkgsrc.org> | 2021-06-16 23:08:42 +0000 |
---|---|---|
committer | dholland <dholland@pkgsrc.org> | 2021-06-16 23:08:42 +0000 |
commit | 6881b72bc6cc838eb04d8beb952ebbe35493a246 (patch) | |
tree | b64fa4e9817c7bb549542c4c67a64d145db3097d /devel/cdecl | |
parent | 18450b16838a943e476108c8d4b5eacbe4173617 (diff) | |
download | pkgsrc-6881b72bc6cc838eb04d8beb952ebbe35493a246.tar.gz |
Add my patch for PR 51100 (from 2016) to devel/cdecl.
This fixes a shift-reduce conflict in the parser that causes e.g.
"static const int" to be rejected as a syntax error.
This patch should have been handled by upstream, but there doesn't seem
to be an upstream.
Diffstat (limited to 'devel/cdecl')
-rw-r--r-- | devel/cdecl/Makefile | 4 | ||||
-rw-r--r-- | devel/cdecl/distinfo | 3 | ||||
-rw-r--r-- | devel/cdecl/patches/patch-cdgram.y | 54 |
3 files changed, 58 insertions, 3 deletions
diff --git a/devel/cdecl/Makefile b/devel/cdecl/Makefile index 64d3799879c..bfc35242f8b 100644 --- a/devel/cdecl/Makefile +++ b/devel/cdecl/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.31 2021/04/21 08:38:49 wiz Exp $ +# $NetBSD: Makefile,v 1.32 2021/06/16 23:08:42 dholland Exp $ DISTNAME= cdecl-2.5 -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= devel MASTER_SITES= # ftp://ftp.netsw.org/softeng/lang/c/tools/cdecl/ diff --git a/devel/cdecl/distinfo b/devel/cdecl/distinfo index 8f54bb56a42..d743a66d675 100644 --- a/devel/cdecl/distinfo +++ b/devel/cdecl/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.13 2015/11/03 03:27:18 agc Exp $ +$NetBSD: distinfo,v 1.14 2021/06/16 23:08:42 dholland Exp $ SHA1 (cdecl-2.5.tar.gz) = b955a0b95b635090360b19de888cb29d5c005296 RMD160 (cdecl-2.5.tar.gz) = 351c36dcc7f18e4d143f2559460025d2de9a83c4 @@ -6,3 +6,4 @@ SHA512 (cdecl-2.5.tar.gz) = 15495f5a794d11f964297c1f39f2f62f89778cd2e791b93f7e6c Size (cdecl-2.5.tar.gz) = 21435 bytes SHA1 (patch-aa) = 6aa8aa0fbe5acfefc6e37c8fd10f318b004fe8a0 SHA1 (patch-ab) = f12ac884f95c9b241cda749b0ea50f6d69e1c6a4 +SHA1 (patch-cdgram.y) = b58b64a83aa01f4bfb18b7c927cae9d11f52482c diff --git a/devel/cdecl/patches/patch-cdgram.y b/devel/cdecl/patches/patch-cdgram.y new file mode 100644 index 00000000000..36c276054ef --- /dev/null +++ b/devel/cdecl/patches/patch-cdgram.y @@ -0,0 +1,54 @@ +$NetBSD: patch-cdgram.y,v 1.1 2021/06/16 23:08:42 dholland Exp $ + +Fix shift/reduce conflict that makes "explain static volatile int foo" +not parse. See PR 51100. + +Should really be handled by upstream, but there does not seem to be an +upstream. + +--- cdgram.y~ 1996-01-12 06:06:58.000000000 +0000 ++++ cdgram.y +@@ -84,10 +84,20 @@ stmt : HELP NL + docast(NullCP, $2.left, $2.right, $2.type); + } + +- | EXPLAIN opt_storage opt_constvol_list type cdecl NL ++ | EXPLAIN opt_constvol_list type cdecl NL + { +- Debug((stderr, "stmt: EXPLAIN opt_storage opt_constvol_list type cdecl\n")); +- Debug((stderr, "\topt_storage='%s'\n", $2)); ++ Debug((stderr, "stmt: EXPLAIN opt_constvol_list type cdecl\n")); ++ Debug((stderr, "\topt_constvol_list='%s'\n", $2)); ++ Debug((stderr, "\ttype='%s'\n", $3)); ++ Debug((stderr, "\tcdecl='%s'\n", $4)); ++ Debug((stderr, "\tprev = '%s'\n", visible(prev))); ++ dodexplain(ds(""), $2, $3, $4); ++ } ++ ++ | EXPLAIN storage opt_constvol_list type cdecl NL ++ { ++ Debug((stderr, "stmt: EXPLAIN storage opt_constvol_list type cdecl\n")); ++ Debug((stderr, "\tstorage='%s'\n", $2)); + Debug((stderr, "\topt_constvol_list='%s'\n", $3)); + Debug((stderr, "\ttype='%s'\n", $4)); + Debug((stderr, "\tcdecl='%s'\n", $5)); +@@ -105,14 +115,13 @@ stmt : HELP NL + dodexplain($2, $3, NullCP, $4); + } + +- | EXPLAIN opt_storage constvol_list cdecl NL ++ | EXPLAIN constvol_list cdecl NL + { +- Debug((stderr, "stmt: EXPLAIN opt_storage constvol_list cdecl\n")); +- Debug((stderr, "\topt_storage='%s'\n", $2)); +- Debug((stderr, "\tconstvol_list='%s'\n", $3)); +- Debug((stderr, "\tcdecl='%s'\n", $4)); ++ Debug((stderr, "stmt: EXPLAIN constvol_list cdecl\n")); ++ Debug((stderr, "\tconstvol_list='%s'\n", $2)); ++ Debug((stderr, "\tcdecl='%s'\n", $3)); + Debug((stderr, "\tprev = '%s'\n", visible(prev))); +- dodexplain($2, $3, NullCP, $4); ++ dodexplain(ds(""), $2, NullCP, $3); + } + + | EXPLAIN '(' opt_constvol_list type cast ')' optNAME NL |