Menu

#4917 Remove some set_location calls from parser

Verified
Maintainability
2016-08-02
2016-07-04
No

Remove some set_location calls from parser

Older versions of Bison (current is 3.0.4) had problems assigning
location data to rules with empty production, possibly related to the
definition of YYLLOCA_DEFAULT when N is zero.

This lead to several workarounds in the code base. A number of them
dropped through the floor in the course of refactoring without
apparent problem, and the original problem does not appear to be
reproducible with the current versions of Bison.

This removes the remaining instances. Should the original problem
reoccur at some point of time (or with some versions of Bison), it
would be noticeable as bad point-and-click messages and/or error
messages with bad location data.

http://codereview.appspot.com/298660043

Discussion

  • Anonymous

    Anonymous - 2016-07-04
    • Description has changed:

    Diff:

    
    
    • Needs: -->
    • Patch: new --> needs_work
     
  • Anonymous

    Anonymous - 2016-07-04

    Fails make

    /home/jlowe/lilypond-git/lily/parser.yy:2923:45: error: stray '@' in program

    Then a bunch of errors after that, I assume caused by this first line:

    --snip--

    /home/jlowe/lilypond-git/lily/parser.yy:196:36: note: in definition of macro 'LOWLEVEL_MAKE_SYNTAX'
    (parser->lexer_->override_input (location).smobbed_copy (), \
    ^
    /home/jlowe/lilypond-git/lily/parser.yy:2923:13: note: in expansion of macro 'MAKE_SYNTAX'
    $$ = MAKE_SYNTAX (repetition_chord, $@,
    ^
    out/lexer.cc: In member function 'virtual int Lily_lexer::yylex()':
    out/lexer.cc:4670:9: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
    yyleng = (size_t) (yy_cp - yy_bp); \
    ^
    out/lexer.cc:5180:3: note: in expansion of macro 'YY_DO_BEFORE_ACTION'
    YY_DO_BEFORE_ACTION;
    ^
    out/lexer.cc:4670:9: warning: conversion to 'int' from 'size_t {aka long unsigned int}' may alter its value [-Wconversion]
    yyleng = (size_t) (yy_cp - yy_bp); \

    etc.

     
    • David Kastrup

      David Kastrup - 2016-07-04

      The warnings unfortunately are as expected and, as opposed to quite a few other warnings we have in other files, hardly avoidable since they are for automatically generated code which we don't have control over.

      With regard to the error: the evidence would suggest otherwise but I tested everything before submission. Nor is this the first time this happened. Huh. Will get things in order and resubmit. Sorry for the extra work.

       
  • David Kastrup

    David Kastrup - 2016-07-04
     
  • Anonymous

    Anonymous - 2016-07-05
    • Needs: -->
    • Patch: new --> review
    • Type: --> Enhancement
     
  • Anonymous

    Anonymous - 2016-07-05

    Passes make, make check and a ful make doc.

     
  • Anonymous

    Anonymous - 2016-07-07
    • Patch: review --> countdown
     
  • Anonymous

    Anonymous - 2016-07-07

    Patch on countdown for July 10th.

     
  • Anonymous

    Anonymous - 2016-07-11
    • Patch: countdown --> push
     
  • Anonymous

    Anonymous - 2016-07-11

    Patch counted down - please push.

     
  • David Kastrup

    David Kastrup - 2016-07-11
    • labels: --> Fixed_2_19_46
    • status: Started --> Fixed
    • Patch: push -->
    • Type: Enhancement --> Maintainability
     
  • David Kastrup

    David Kastrup - 2016-07-11

    Pushed to staging as
    commit 7d7589bdf70cb227b032220bae87eda2045ccc8e
    Author: David Kastrup dak@gnu.org
    Date: Mon Jul 4 10:08:41 2016 +0200

    Issue 4917: Remove some set_location calls from parser
    
    Older versions of Bison (current is 3.0.4) had problems assigning
    location data to rules with empty production, possibly related to the
    definition of YYLLOCA_DEFAULT when N is zero.
    
    This lead to several workarounds in the code base.  A number of them
    dropped through the floor in the course of refactoring without
    apparent problem, and the original problem does not appear to be
    reproducible with the current versions of Bison.
    
    This removes the remaining instances.  Should the original problem
    reoccur at some point of time (or with some versions of Bison), it
    would be noticeable as bad point-and-click messages and/or error
    messages with bad location data.
    
     
  • Phil Holmes

    Phil Holmes - 2016-08-02
    • status: Fixed --> Verified
     
MongoDB Logo MongoDB