BLSS
BLSS copied to clipboard
Fail to build on nginx 1.15
I get this error
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I ../BLSS -I objs -I src/http -I src/http/modules
-o objs/addon/BLSS/ngx_rtmp_init.o
../BLSS/ngx_rtmp_init.c
../BLSS/ngx_rtmp_init.c: In function ‘ngx_http_flv_init_connection’:
../BLSS/ngx_rtmp_init.c:93:25: error: this statement may fall through [-Werror=implicit-fallthrough=]
unix_socket = 1;
~~~~~~~~~~~~^~~
../BLSS/ngx_rtmp_init.c:95:9: note: here
default: /* AF_INET /
^~~~~~~
../BLSS/ngx_rtmp_init.c:124:25: error: this statement may fall through [-Werror=implicit-fallthrough=]
unix_socket = 1;
~~~~~~~~~~~~^~~
../BLSS/ngx_rtmp_init.c:126:9: note: here
default: / AF_INET /
^~~~~~~
../BLSS/ngx_rtmp_init.c: In function ‘ngx_rtmp_init_connection’:
../BLSS/ngx_rtmp_init.c:308:25: error: this statement may fall through [-Werror=implicit-fallthrough=]
unix_socket = 1;
~~~~~~~~~~~~^~~
../BLSS/ngx_rtmp_init.c:310:9: note: here
default: / AF_INET /
^~~~~~~
../BLSS/ngx_rtmp_init.c:339:25: error: this statement may fall through [-Werror=implicit-fallthrough=]
unix_socket = 1;
~~~~~~~~~~~~^~~
../BLSS/ngx_rtmp_init.c:341:9: note: here
default: / AF_INET */
^~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/BLSS/ngx_rtmp_init.o] Error 1
make[1]: Leaving directory `/home/ec2-user/nginx-1.15.0'
make: *** [build] Error 2
Can you please let me know which gcc
or clang
version you are using to compile?
gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)
I made pull request #109 to solve your problem, please try to get latest code, thanks!
Thank you! I'll test tonight :)
Same error :(
cc -c -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I src/core -I src/event -I src/event/modules -I src/os/unix -I ../BLSS -I objs -I src/http -I src/http/modules \
-o objs/addon/BLSS/ngx_rtmp_amf.o \
../BLSS/ngx_rtmp_amf.c
../BLSS/ngx_rtmp_amf.c: In function ‘ngx_rtmp_amf_read’:
../BLSS/ngx_rtmp_amf.c:331:24: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (elts->type & NGX_RTMP_AMF_OPTIONAL) {
^
../BLSS/ngx_rtmp_amf.c:334:17: note: here
case NGX_ERROR:
^~~~
../BLSS/ngx_rtmp_amf.c:398:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (ngx_rtmp_amf_get(ctx, &max_index, 4) != NGX_OK) {
^
../BLSS/ngx_rtmp_amf.c:402:13: note: here
case NGX_RTMP_AMF_OBJECT:
^~~~
../BLSS/ngx_rtmp_amf.c: In function ‘ngx_rtmp_amf_write’:
../BLSS/ngx_rtmp_amf.c:592:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
if (ngx_rtmp_amf_put(ctx, &max_index, 4) != NGX_OK) {
^
../BLSS/ngx_rtmp_amf.c:596:13: note: here
case NGX_RTMP_AMF_OBJECT:
^~~~
cc1: all warnings being treated as errors
make[1]: *** [objs/addon/BLSS/ngx_rtmp_amf.o] Error 1
i see, same error but different place.
https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
It looks like gcc 7 has added a default fallthrough warning behaviour. Note that it isn't present in gcc 6:
- -Wimplicit-fallthrough=0 disables the warning altogether.
- -Wimplicit-fallthrough=1 treats any kind of comment as a “falls through” comment.
- -Wimplicit-fallthrough=2 essentially accepts any comment that contains something that matches (case insensitively) “falls?[ \t-]*thr(ough|u)” regular expression.
- -Wimplicit-fallthrough=3 case sensitively matches a wide range of regular expressions, listed in the GCC manual. E.g., all of these are accepted: /* Falls through. / / fall-thru / / Else falls through. / / FALLTHRU / / … falls through … */ etc.
- -Wimplicit-fallthrough=4 also, case sensitively matches a range of regular expressions but is much more strict than level =3.
- -Wimplicit-fallthrough=5 doesn’t recognize any comments.
i think gcc flag -Wimplicit-fallthrough=0
may temporary solve your problem, and i will find whether there is an other way.
Great, I'll try it, thanks :)
Now it compiled, but had errors with the rtmp module params. Seems like a rtmp module config is not compatible with this one