Menu

#708 gram.c line 271 in bison 3.0.4 problem with rp>=0 in loop

v1.0 (example)
closed-invalid
nobody
None
5
2018-02-23
2018-02-22
No

Q: in a decrementing for loop, how do you detect when unsigned number index or ptr goes to value equivalent of -1? (goes past 0?)
A: check if value is greater than initial value. it will be greater than initial value and 0xffffffffffffffffULL or appropriate size for platform.

wow. look at that line 271. it does rp++ when it should do rp--
and line 260 same thing.
use findstr.exe in windows to
findstr ">= 0"

  .:
closure.c
derives.c
gram.c
gram.h
lalr.c
LR0.c
nullable.c
print.c
print_graph.c
reduce.c
tables.c

Discussion

  • NightStrike

    NightStrike - 2018-02-22

    Not only didn't you include the code you are talking about, but this is not a forum to ask for help with writing code. Please try stackoverflow. Closing as invalid.

     
  • NightStrike

    NightStrike - 2018-02-22
    • status: open --> closed-invalid
     

Log in to post a comment.