[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Adding %destructor surprisingly enables warnings
From: |
Askar Safin |
Subject: |
Adding %destructor surprisingly enables warnings |
Date: |
Fri, 16 Nov 2018 14:23:42 +0300 |
Hi. I noticed strange behavior in Bison. Probably I simply don't understand
something. Or I found a bug.
This is my input file: http://paste.debian.net/hidden/a72e301e . I process it
using the following command line: "bison -do test.tab.cpp test.ypp".
Bison shows no warnings.
Then I add one line. This is edited file:
http://paste.debian.net/hidden/1d8be22a . And then I process it using the same
command line.
And I see the following warnings:
test.ypp:63.3-66.5: warning: unset value: $$ [-Wother]
ID[id]
^^^^^^
test.ypp:71.3-73.5: warning: unset value: $$ [-Wother]
| '\'' expr[e]
^^^^^^^^^^^^
test.ypp:71.8-11: warning: unused value: $2 [-Wother]
| '\'' expr[e]
^^^^
test.ypp:78.3-80.5: warning: unset value: $$ [-Wother]
%empty
^^^^^^
test.ypp:81.3-83.5: warning: unset value: $$ [-Wother]
| expr[car] exprs[cdr]
^^^^^^^^^^^^^^^^^^^^
test.ypp:81.3-6: warning: unused value: $1 [-Wother]
| expr[car] exprs[cdr]
^^^^
test.ypp:81.13-17: warning: unused value: $2 [-Wother]
| expr[car] exprs[cdr]
^^^^^
My OS is Debian Stretch x86_64. Bison installed from Debian repo. "dpkg -l
bison" reports "2:3.0.4.dfsg-1+b1". "bison --version" reports "3.0.4".
So, it seems that Bison for unknown reason ignores "%define parse.error
verbose", but %destructor somehow causes Bison to actually show warnings.
==
Askar Safin
http://vk.com/safinaskar
- Adding %destructor surprisingly enables warnings,
Askar Safin <=