Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiling zephir_parser fails #1238

Closed
joyider opened this issue Apr 15, 2016 · 3 comments
Closed

compiling zephir_parser fails #1238

joyider opened this issue Apr 15, 2016 · 3 comments

Comments

@joyider
Copy link

joyider commented Apr 15, 2016

Trying to compile zephir_parser gives

n file included from /usr/include/string.h:634:0,
                 from /home/mercury/zephir-ubuntu/parser/parser/scanner.c:22:
/home/mercury/zephir-ubuntu/parser/parser/scanner.c:30:14: error: expected identifier or '(' before '__extension__'
 extern char *strndup(const char *s, size_t len);
              ^
/home/mercury/zephir-ubuntu/parser/parser/scanner.c: In function 'xx_get_token':
/home/mercury/zephir-ubuntu/parser/parser/scanner.c:1276:4: warning: implicit declaration of function 'free' [-Wimplicit-function-declaration]
    free(token->value);
    ^
/home/mercury/zephir-ubuntu/parser/parser/scanner.c:1276:4: warning: incompatible implicit declaration of built-in function 'free'
/home/mercury/zephir-ubuntu/parser/parser/scanner.c:1276:4: note: include '<stdlib.h>' or provide a declaration of 'free'
make: *** [parser/scanner.lo] Error 1
make: *** Waiting for unfinished jobs....

libtool: compile:  gcc -I. -I/home/mercury/zephir-ubuntu/parser -DPHP_ATOM_INC -I/home/mercury/zephir-ubuntu/parser/include -I/home/mercury/zephir-ubuntu/parser/main -I/home/mercury/zephir-ubuntu/parser -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/mercury/zephir-ubuntu/parser/zephir_parser.c  -fPIC -DPIC -o .libs/zephir_parser.o
libtool: compile:  gcc -I. -I/home/mercury/zephir-ubuntu/parser -DPHP_ATOM_INC -I/home/mercury/zephir-ubuntu/parser/include -I/home/mercury/zephir-ubuntu/parser/main -I/home/mercury/zephir-ubuntu/parser -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/mercury/zephir-ubuntu/parser/parser/parser.c  -fPIC -DPIC -o parser/.libs/parser.o
libtool: compile:  gcc -I. -I/home/mercury/zephir-ubuntu/parser -DPHP_ATOM_INC -I/home/mercury/zephir-ubuntu/parser/include -I/home/mercury/zephir-ubuntu/parser/main -I/home/mercury/zephir-ubuntu/parser -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/mercury/zephir-ubuntu/parser/parser/scanner.c  -fPIC -DPIC -o parser/.libs/scanner.o
Makefile:198: recipe for target 'parser/scanner.lo' failed

The issuse seems to be line 30 in scanner.re

extern char *strndup(const char *s, size_t len);

Without further code knowledge this seems out of context, removing that line solves the issue and compiling succeeds

@mruz
Copy link
Contributor

mruz commented Apr 15, 2016

Similar to #1142 (comment)

@andresgutierrez
Copy link
Contributor

This is fixed in latest master

@joyider
Copy link
Author

joyider commented Apr 28, 2016

Confirmed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants