Shop Learn
spin2cpp build problem — Parallax Forums

spin2cpp build problem

David BetzDavid Betz Posts: 14,365
edited 2020-11-26 14:17 in Propeller 2
I've been away for a while and decided to update spin2cpp to the latest code. I did a "git pull" but when I type "make" I get the following error:
dbetz@Davids-Mac-mini-2 spin2cpp % make
bison -t -b ./build/spin -d frontends/spin/spin.y
frontends/spin/spin.y:7.9-18: syntax error, unexpected identifier, expecting string
make: *** [build/spin.tab.h] Error 1
This is when attempting to build on the Mac with the Xcode command line tools.

Comments

  • David Betz wrote: »
    I've been away for a while and decided to update spin2cpp to the latest code. I did a "git pull" but when I type "make" I get the following error:
    dbetz@Davids-Mac-mini-2 spin2cpp % make
    bison -t -b ./build/spin -d frontends/spin/spin.y
    frontends/spin/spin.y:7.9-18: syntax error, unexpected identifier, expecting string
    make: *** [build/spin.tab.h] Error 1
    
    This is when attempting to build on the Mac with the Xcode command line tools.

    It looks like you'll need a newer version of bison. I can't build on my Mac right now because after I upgraded Xcode stopped working, but my Mac mini can't be upgraded to the Mac OS that the newest Xcode needs, so for now I'm stuck :(. But probably there's some way to get a stand-alone version of bison. If all else fails you can probably build it from source.
  • I used brew to install a new version if bison and got spin2cpp to build with the following commands:
    dbetz@Davids-Mac-mini-2 spin2cpp % export PATH=/usr/local/opt/bison/bin:$PATH 
    dbetz@Davids-Mac-mini-2 spin2cpp % make
    
    However, I ran into a warning. Not sure why Xcode is complaining about this though.
    bison -t -b ./build/spin -d frontends/spin/spin.y
    frontends/spin/spin.y: warning: 25 shift/reduce conflicts [-Wconflicts-sr]
    frontends/spin/spin.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
    bison -t -b ./build/basic -d frontends/basic/basic.y
    frontends/basic/basic.y: warning: 15 shift/reduce conflicts [-Wconflicts-sr]
    frontends/basic/basic.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
    bison -t -b ./build/cgram -d frontends/c/cgram.y
    frontends/c/cgram.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
    frontends/c/cgram.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/lexer.o -c frontends/lexer.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/symbol.o -c symbol.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/ast.o -c ast.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/expr.o -c expr.c
    expr.c:2985:24: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        while ((expr->kind == AST_STMTLIST)) {
                ~~~~~~~~~~~^~~~~~~~~~~~~~~
    expr.c:2985:24: note: remove extraneous parentheses around the comparison to silence this warning
        while ((expr->kind == AST_STMTLIST)) {
               ~           ^              ~
    expr.c:2985:24: note: use '=' to turn this equality comparison into an assignment
        while ((expr->kind == AST_STMTLIST)) {
                           ^~
                           =
    1 warning generated.
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/dofmt.o -c util/dofmt.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/flexbuf.o -c util/flexbuf.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/lltoa_prec.o -c util/lltoa_prec.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/strupr.o -c util/strupr.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/strrev.o -c util/strrev.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/strdupcat.o -c util/strdupcat.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/to_utf8.o -c util/to_utf8.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/from_utf8.o -c util/from_utf8.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/preprocess.o -c preprocess.c
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/testlex testlex.c build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o -lm
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/common.o -c frontends/common.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/case.o -c frontends/case.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/spinc.o -c spinc.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/functions.o -c functions.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/cse.o -c cse.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/loops.o -c loops.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/hloptimize.o -c frontends/hloptimize.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/types.o -c frontends/types.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/pasm.o -c pasm.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/outdat.o -c backends/dat/outdat.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/outlst.o -c backends/dat/outlst.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/outobj.o -c backends/objfile/outobj.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/spinlang.o -c frontends/spin/spinlang.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/basiclang.o -c frontends/basic/basiclang.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/clang.o -c frontends/c/clang.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/outasm.o -c backends/asm/outasm.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/assemble_ir.o -c backends/asm/assemble_ir.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/optimize_ir.o -c backends/asm/optimize_ir.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/inlineasm.o -c backends/asm/inlineasm.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/compress_ir.o -c backends/asm/compress_ir.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/outcpp.o -c backends/cpp/outcpp.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/cppfunc.o -c backends/cpp/cppfunc.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/outgas.o -c backends/cpp/outgas.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/cppexpr.o -c backends/cpp/cppexpr.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/cppbuiltin.o -c backends/cpp/cppbuiltin.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/directive.o -c mcpp/directive.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/expand.o -c mcpp/expand.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/mbchar.o -c mcpp/mbchar.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/mcpp_eval.o -c mcpp/mcpp_eval.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/mcpp_main.o -c mcpp/mcpp_main.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/mcpp_system.o -c mcpp/mcpp_system.c
    gcc -MMD -MP -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/mcpp_support.o -c mcpp/mcpp_support.c
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -DGITREV=v5.0.0-11-g15693cbc -o build/version.o -c version.c
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/spin.tab.o -c build/spin.tab.c
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/basic.tab.o -c build/basic.tab.c
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/cgram.tab.o -c build/cgram.tab.c
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/spin2cpp spin2cpp.c cmdline.c build/common.o build/case.o build/spinc.o build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o build/functions.o build/cse.o build/loops.o build/hloptimize.o build/types.o build/pasm.o build/outdat.o build/outlst.o build/outobj.o build/spinlang.o build/basiclang.o build/clang.o build/outasm.o build/assemble_ir.o build/optimize_ir.o build/inlineasm.o build/compress_ir.o build/outcpp.o build/cppfunc.o build/outgas.o build/cppexpr.o build/cppbuiltin.o build/directive.o build/expand.o build/mbchar.o build/mcpp_eval.o build/mcpp_main.o build/mcpp_system.o build/mcpp_support.o build/version.o build/spin.tab.o build/basic.tab.o build/cgram.tab.o -lm
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/flexspin flexspin.c cmdline.c build/common.o build/case.o build/spinc.o build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o build/functions.o build/cse.o build/loops.o build/hloptimize.o build/types.o build/pasm.o build/outdat.o build/outlst.o build/outobj.o build/spinlang.o build/basiclang.o build/clang.o build/outasm.o build/assemble_ir.o build/optimize_ir.o build/inlineasm.o build/compress_ir.o build/outcpp.o build/cppfunc.o build/outgas.o build/cppexpr.o build/cppbuiltin.o build/directive.o build/expand.o build/mbchar.o build/mcpp_eval.o build/mcpp_main.o build/mcpp_system.o build/mcpp_support.o build/version.o build/spin.tab.o build/basic.tab.o build/cgram.tab.o -lm
    gcc -g -Wall -I. -I./build -DFLEXSPIN_BUILD -o build/flexcc flexcc.c cmdline.c build/common.o build/case.o build/spinc.o build/lexer.o build/symbol.o build/ast.o build/expr.o build/dofmt.o build/flexbuf.o build/lltoa_prec.o build/strupr.o build/strrev.o build/strdupcat.o build/to_utf8.o build/from_utf8.o build/preprocess.o build/functions.o build/cse.o build/loops.o build/hloptimize.o build/types.o build/pasm.o build/outdat.o build/outlst.o build/outobj.o build/spinlang.o build/basiclang.o build/clang.o build/outasm.o build/assemble_ir.o build/optimize_ir.o build/inlineasm.o build/compress_ir.o build/outcpp.o build/cppfunc.o build/outgas.o build/cppexpr.o build/cppbuiltin.o build/directive.o build/expand.o build/mbchar.o build/mcpp_eval.o build/mcpp_main.o build/mcpp_system.o build/mcpp_support.o build/version.o build/spin.tab.o build/basic.tab.o build/cgram.tab.o -lm
    
  • TorTor Posts: 2,010
    That last warning seems to be about gcc taking "if (( a = b))" (double parentheses) as a hint from the programmer that 'yes, I really meant to use "=", not "==" here.' So, gcc gives a warning for "if (a = b)" but not for "if ((a == b))" (this convention is not followed by every other non-gcc compiler, but some do)). So, gcc then decides to throw a warning if you use "if ((a == b))": "You hinted that you really meant to use just '=' here, but you still use '=='"
  • Tor wrote: »
    That last warning seems to be about gcc taking "if (( a = b))" (double parentheses) as a hint from the programmer that 'yes, I really meant to use "=", not "==" here.' So, gcc gives a warning for "if (a = b)" but not for "if ((a == b))" (this convention is not followed by every other non-gcc compiler, but some do)). So, gcc then decides to throw a warning if you use "if ((a == b))": "You hinted that you really meant to use just '=' here, but you still use '=='"
    That sounds like a warning that should be turned off! :smile:

Sign In or Register to comment.