ChrisDodd / btyacc

Backtracking yacc
18 stars 5 forks source link

Problems in test subdirectory under macOS #20

Closed teshields closed 7 years ago

teshields commented 7 years ago

Environment: macOS Sierra (10.12.6) with Command Line Tools for Xcode 8.3.2 Command line compiler (cc): Apple LLVM version 8.1.0 (clang-802.0.42)

I experienced 2 problems with the 'test/runtests' script:

  1. 'expr' on line 16 fails with "syntax error" when runtests is invoked with no arguments
  2. 'sed' on line 36 fails with "extra characters at the end of p command"

I also experienced a spurious error "error: self-comparison always evaluates to false" for each of the test cases that include "-Werror" on the 'cc' command line due to the occurrence of the following code in 'btyaccpa.ske': if(yyps->errflag != yyps->errflag) goto yyerrquiet;

The attached patch works around these issues in my macOS environment: btyacc-20170602.test.patch.txt

ChrisDodd commented 7 years ago

Thanks for the patch -- I've checked a slightly different fix that doesn't involve extra compiler flags to avoid warnings. Does this work for you?

teshields commented 7 years ago

Chris, your fix works for me. Thanks. Tom