gnolizuh / BLSS

NGINX-based Live Media Streaming Server
Other
196 stars 73 forks source link

Fail to build on nginx 1.15 #107

Open jersobh opened 6 years ago

jersobh commented 6 years ago

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
gnolizuh commented 6 years ago

Can you please let me know which gcc or clang version you are using to compile?

jersobh commented 6 years ago

gcc version 7.3.1 20180303 (Red Hat 7.3.1-5) (GCC)

gnolizuh commented 6 years ago

I made pull request #109 to solve your problem, please try to get latest code, thanks!

jersobh commented 6 years ago

Thank you! I'll test tonight :)

jersobh commented 6 years ago

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
gnolizuh commented 6 years ago

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:

i think gcc flag -Wimplicit-fallthrough=0 may temporary solve your problem, and i will find whether there is an other way.

jersobh commented 6 years ago

Great, I'll try it, thanks :)

jersobh commented 6 years ago

Now it compiled, but had errors with the rtmp module params. Seems like a rtmp module config is not compatible with this one