pcb

Bison warnings

Bug #1776089 reported by Chad Parker on 2018-06-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
pcb
Low
Chad Parker

Bug Description

There are three bison warnings when master (as of 20180610)

/home/cparker/src/pcb/pcb-debug/build/src/../../src/parse_y.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
/home/cparker/src/pcb/pcb-debug/build/src/../../src/parse_y.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]

/home/cparker/src/pcb/pcb-debug/build/src/../../src/res_parse.y:37.1-13: warning: deprecated directive, use ‘%name-prefix’ [-Wdeprecated]
 %name-prefix="res"
 ^^^^^^^^^^^^^

The first two I'm confused about how to fix. The problem is indicated to be with state 0.

The third one is easy. Replace the = with a <space>.

Chad Parker (parker-charles) wrote :

Okay, I managed to fix the bison warnings. Branch: LP1776089

This took a while to figure out. One issue had to do with the path for loading elements to a buffer. If "Element" is the first thing in a file, either of these could be valid parse paths:

parse -> parsepcb -> element

or

parse -> parsedata -> pcbdata -> pcbdefinitions -> pcbdefinition -> element

The first was intended for parsing element files, the second for parsing elements in pcb files or "data" files.

I've fixed this by removing the first path, and merging it with the second path. There's a new variable file_type that is an enumerated type that is set depending on the type of file being parsed. The second path now checks that variable and parses the element data appropriately.

The other conflict was similar. There were two paths to "error".

parse -> error

or

parse -> parsedata -> pcbdata -> pcbdefinitions -> pcbdefinition -> error

I fixed this by deleting the second path. This could be used for error recovery, but, our error recovery strategy is presently to abort, it doesn't really do anything anyway. A syntax error is still reported and the load is aborted.

Changed in pcb:
importance: Undecided → Low
status: New → In Progress
Changed in pcb:
milestone: none → pcb-4.2.0
Changed in pcb:
assignee: nobody → Chad Parker (parker-charles)
Bert Timmerman (bert-timmerman) wrote :

Hi Charles,

This branch builds OK for me, even when rebased on top of master HEAD, although I seem to have bison-2.4.1 which configure thinks "bad".

AFACT, you can push this to master unless there is more to fix.

Kind regards,

Bert Timmerman.

Chad Parker (parker-charles) wrote :

Done.

Changed in pcb:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints