Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #14281

Re: ./parse.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]

Path csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail
From Piotr Grzybowski <narsil.pl@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: ./parse.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
Date Wed, 27 Jun 2018 16:33:05 +0200
Lines 39
Approved bug-bash@gnu.org
Message-ID <mailman.2619.1530109999.1292.bug-bash@gnu.org> (permalink)
References <5260CA01-40C6-41A8-A858-760C84CB8FBB@gmail.com> <608b0390-0483-fede-f1f7-d6fad57d5735@case.edu>
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0 (Apple Message framework v1085)
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding quoted-printable
X-Trace usenet.stanford.edu 1530109999 24399 208.118.235.17 (27 Jun 2018 14:33:19 GMT)
X-Complaints-To action@cs.stanford.edu
To bug-bash <bug-bash@gnu.org>
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=EJNuz4DIof7L17vnz+/s5MbgusficLYVp77aJV/FLag=; b=qENCOEB/ZL2pB+vL1kNRt1lhCAZUJmDEP0TtLDLDVlOuIiiGzfp5IRed16Ra88tQAk UW1uua2kbkx3SERadnWQFWMqjI/rUro0ob5BwtcMvQSEkN5/+gzFREC+RCoiwhKk9ybM qWVu7lPOcssP4oK94sPv8Zk9VgOdbI2asaNXRW1Kfx+XlW27kvd0PJFgrPU/0busIdEs 9vYqvZjxMq8p521rTG8Gau1VK7LmOlN2N/HUx10M7j2K9zduIEgGZb+XG+vwdTvyI9UG hwAsIh+bp3K1fJDyyEW49k2QclfrG9zhUiyv5qdPvPVsL+Fmb9bIXwjfaP9TpPnCj0Aw AqXg==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=EJNuz4DIof7L17vnz+/s5MbgusficLYVp77aJV/FLag=; b=HYQF7qpi3n/AD9aiCXIzFTzjLeIAasnBpPTQYO1stp9NJl6I6CGpsAnvPaDx6MkDma plkG5yBGtzeY/U19Iy3BsAO1yTtGG3M4tFP8HzLafGugUDdMWZ+tAclbD8wXX5GSbb40 gK6eHASyH7y41w4K8RHVP55buLXc5pnWUyFhcd8dE56cS9yfmo43bBQdtOVXffwvLa8u bgzGrVKH7Z0csI8Wb8rEoe97BN6OyWLTdO42f8XSJtzryJelTu08Uuor+wnypeEAh9oG 4cdCudVtKqXgW7gZZyuF3wrIaSjODsdWqiXOK7xrnafo6XzLbInZIZQ19qlT59egwH6n YoEQ==
X-Gm-Message-State APt69E127umUsweVfuq22tIZ9ASpBR61QwtiP3uACqWufnV2hML4+1Rw xReDMIjdhKWJsC4y8HHB/Yh5qw==
X-Google-Smtp-Source AAOMgpc2X8f2cJO9JbAzFDc/ZBuCQPTlr+Pd7RDgnKnUllnTtafwV5iQMrF5EpHx/R2zpmJddQsczA==
X-Received by 2002:a2e:f11:: with SMTP id 17-v6mr4599994ljp.47.1530109989222; Wed, 27 Jun 2018 07:33:09 -0700 (PDT)
In-Reply-To <608b0390-0483-fede-f1f7-d6fad57d5735@case.edu>
X-Mailer Apple Mail (2.1085)
X-detected-operating-system by eggs.gnu.org: Genre and OS details not recognized.
X-Received-From 2a00:1450:4864:20::22c
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.21
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <http://lists.gnu.org/archive/html/bug-bash/>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
Xref csiph.com gnu.bash.bug:14281

Show key headers only | View raw


On 27 Jun 2018, at 14:57, Chet Ramey wrote:

> On 6/27/18 6:59 AM, Piotr Grzybowski wrote:
> 
>> +function_newline_list: '(' ')' | function_newline_list '\n'
>> +       ;
>> +
> 
> This would appear to allow constructs like
> 
> foo()
> () ()
> {
> 	function body
> }

only by the look of things ;-) (thats what I meant in P.S.) actually those tokens are not allowed:

bash-5.0$ cat /tmp/m.sh
foo()
() ()
{
        function body
}

bash-5.0$ . /tmp/m.sh
bash: /tmp/m.sh: line 2: syntax error near unexpected token `)'
bash: /tmp/m.sh: line 2: `() ()'

 I am sure function_newline_list can be rewritten in a better way though.

cheers,
pg


Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: ./parse.y: warning: 1 shift/reduce conflict [-Wconflicts-sr] Piotr Grzybowski <narsil.pl@gmail.com> - 2018-06-27 16:33 +0200

csiph-web