cucumber-attic / bool

Cross-platform boolean expression parser and interpreter
MIT License
36 stars 14 forks source link

Error in lexer.c building on Fedora 18 x86_64 #24

Closed dkowis closed 11 years ago

dkowis commented 11 years ago

This is on a fresh pull, it went ahead and built a bison 2.7 for me.

cd c && make
make[1]: Entering directory `/home/dkowis/gitwork/cucumber/bool/c'
flex --version
flex 2.5.36
flex lexer.l
# Remove warnings from lexer.c by injecting a few UNUSED macros with surgical precision.
sed -i'' -e 's/exit( YY_EXIT_FAILURE );/UNUSED(yyscanner);exit( YY_EXIT_FAILURE );/g' lexer.c
sed -i'' -e 's/return (void \*) malloc( size );/UNUSED(yyscanner);return (void *) malloc( size );/g' lexer.c
sed -i'' -e 's/return (void \*) realloc( (char \*) ptr, size );/UNUSED(yyscanner);return (void *) realloc( (char *) ptr, size );/g' lexer.c
sed -i'' -e 's/free( (char \*) ptr );/UNUSED(yyscanner);free( (char *) ptr );/g' lexer.c
# Inject missing initializations into lexer.c with surgical precision.
sed -i'' -e 's/b->yy_fill_buffer = 0;/b->yy_fill_buffer = 0; b->yy_bs_lineno = 1; b->yy_bs_column = 1;/g' lexer.c
bison --version
bison (GNU Bison) 2.7
Written by Robert Corbett and Richard Stallman.

Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bison parser.y
cc -fPIC -O2 -Werror -Wall -Wextra   -c -o parser.o parser.c
cc -fPIC -O2 -Werror -Wall -Wextra   -c -o lexer.o lexer.c
lexer.c: In function ‘yylex’:
lexer.c:788:23: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
lexer.c: In function ‘yy_scan_bytes’:
lexer.c:1616:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors
make[1]: *** [lexer.o] Error 1
make[1]: Leaving directory `/home/dkowis/gitwork/cucumber/bool/c'
make: *** [c] Error 2
aslakhellesoy commented 11 years ago

Do you still get warnings with flex 2.5.37?

dkowis commented 11 years ago

I'll have to manually install flex 2.5.37, I'll try to do that this evening.