srs: Disable -Werror for http parser.
I am getting this error when installing on ubuntu 17.10.
build http-parser-2.1 patching file Makefile cc -I. -DHTTP_PARSER_STRICT=1 -Wall -Wextra -Werror -O0 -g -c http_parser.c http_parser.c: In function ‘http_parser_parse_url’:’
This line is already in English and does not require translation.
http_parser.c:2093:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
found_at = 1;
~~~~~~
cc1: all warnings being treated as errors
Makefile:40: recipe for target ‘http_parser.o’ failed
make: *** [http_parser.o] Error 1
build http-parser-2.1 failed, ret=2^
http_parser.c:2096:7: note: here
case s_req_server:
^
TRANS_BY_GPT3
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 15 (4 by maintainers)
You should change the source code:
the file
http_parser.c
in3rdparty/http-parser-2.1.zip
change
to
I had the configure failed when compile on Ubuntu Studio 18.04, with line # 2095 of “http-parser-2.1/http_parser.c” where the comment was FALLTROUGH and not FALLTHROUGH, note the first “H” is missing.
For the user that may not know how to update the source in the zip file, the following commands show how I did it and verified it working:
cd ~ && git clone https://github.com/ossrs/srs && cd srs/trunk ./configure && make
===> configure FAILS – update http-parser source zip file
mkdir temp cd temp unzip …/http-parser-2.1.zip grep -n “FALLT” ./http-parser-2.1/http_parser.c sed -e s/FALLTROUGH/FALLTHROUGH/ -i ./http-parser-2.1/http_parser.c grep -n “FALLT” ./http-parser-2.1/http_parser.c mv …/http-parser-2.1.zip …/http-parser-2.1-orig.zip zip …/http-parser-2.1.zip http-parser-2.1/*
===> back to srs/trunk folder to configure and make
cd …/… ./configure && make
===> test
./objs/srs -c conf/srs.conf tail -f ./objs/srs.log ps -aF
build srs1.0relese met this error. I solved it by : Change Makefile in 3rdparty/http-parser-2.1.zip by delete -Werror in the line start with “CFLAGS”.
then, both ./configure and make OK.
SRS3 has no problem. We don’t plan to solve the compilation issue in SRS2, so everyone needs to handle it themselves.
TRANS_BY_GPT3