openresty/sregex

make error on centos

loveshell opened this issue · 2 comments

在ubuntu下没有问题,在centos下make出错

我的环境是:
os:centos 6.3
kernel:2.6.32-220.el6.x86_64
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

以下是我下载后的操作
[root@server ~]# git clone https://github.com/agentzh/sregex.git
Initialized empty Git repository in /root/sregex/.git/
remote: Counting objects: 1229, done.
remote: Compressing objects: 100% (588/588), done.
remote: Total 1229 (delta 857), reused 1012 (delta 640)
Receiving objects: 100% (1229/1229), 391.62 KiB | 161 KiB/s, done.
Resolving deltas: 100% (857/857), done.
[root@server ~]# cd sregex/
[root@server sregex]# ls
bench dynasm LICENSE Makefile misc README.markdown src t util
[root@server sregex]# make
BISON src/sregex/sre_yyparser.h
CC src/sregex/sre_palloc.o
CC src/sregex/sre_regex.o
CC src/sregex/sre_yyparser.o
cc1: warnings being treated as errors
src/sregex/sre_yyparser.c: In function ‘yyparse’:
src/sregex/sre_yyparser.c:1218: error: ‘yylloc.last’ may be used uninitialized in this function
src/sregex/sre_yyparser.c:1218: error: ‘yylloc.pos’ may be used uninitialized in this function
make: *** [src/sregex/sre_yyparser.o] Error 1
[root@server sregex]#

Could you please try out the following commands on your side?

git reset --hard
touch src/sregex/sre_yyparser.c src/sregex/sre_yyparser.h
make

I cannot reproduce your errors on my side with bison 2.7 and 4.7.2 on Linux x86_64. And it may be an issue in your particular version of bison or gcc.

I've turned off -Werror in Makefile which should solve this issue.