Skip to content
New issue

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

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

Already on GitHub? # to your account

Fail to build on nginx 1.15 #107

Open
jersobh opened this issue Jun 26, 2018 · 8 comments
Open

Fail to build on nginx 1.15 #107

jersobh opened this issue Jun 26, 2018 · 8 comments

Comments

@jersobh
Copy link

jersobh commented Jun 26, 2018

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
Copy link
Owner

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

@jersobh
Copy link
Author

jersobh commented Jul 23, 2018

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

@gnolizuh
Copy link
Owner

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

@jersobh
Copy link
Author

jersobh commented Jul 24, 2018

Thank you! I'll test tonight :)

@jersobh
Copy link
Author

jersobh commented Jul 25, 2018

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
Copy link
Owner

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.

@gnolizuh gnolizuh mentioned this issue Jul 26, 2018
@jersobh
Copy link
Author

jersobh commented Jul 26, 2018

Great, I'll try it, thanks :)

@jersobh
Copy link
Author

jersobh commented Jul 26, 2018

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

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

No branches or pull requests

2 participants