winshining/nginx-http-flv-module

[bug] compile error

Closed this issue · 3 comments

Configure:
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.12.2/debian/debuild-base/nginx-1.12.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --add-dynamic-module=/usr/src/nginx-ts-module --add-dynamic-module=/usr/src/nginx-http-flv-module

Does not compile, ends with error:

cc -c -fPIC -pipe -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -g -O2 -fdebug-prefix-map=/data/builder/debuild/nginx-1.12.2/debian/debuild-base/nginx-1.12.2=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Wp,-D_FORTIFY_SOURCE=2 -fPIC -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/src/nginx-http-flv-module -I objs -I src/http -I src/http/modules -I src/http/v2 -I src/mail -I src/stream
-o objs/addon/nginx-http-flv-module/ngx_rtmp_codec_module.o
/usr/src/nginx-http-flv-module/ngx_rtmp_codec_module.c
/usr/src/nginx-http-flv-module/ngx_rtmp_codec_module.c: In function ‘ngx_rtmp_codec_parse_avc_header_in_keyframe’:
/usr/src/nginx-http-flv-module/ngx_rtmp_codec_module.c:433:21: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
if (len + 3 > left) {
^
cc1: all warnings being treated as errors

Many thanks,

WTF! It complies well on my machine.
On line 291, ngx_int_t -> ngx_uint_t, then it may help. By the way, you'd better modify the line 290 as well.

Yes, that compiled, but I also had to comment out line 174 and 1990 of ngx_rtmp_upstream.c as :
/usr/src/nginx-http-flv-module/ngx_rtmp_upstream.c: In function ‘ngx_rtmp_upstream_resolve_handler’:
/usr/src/nginx-http-flv-module/ngx_rtmp_upstream.c:174:36: error: variable ‘c’ set but not used [-Werror=unused-but-set-variable]
ngx_connection_t *c;
^
/usr/src/nginx-http-flv-module/ngx_rtmp_upstream.c: In function ‘ngx_rtmp_upstream_send_handshake’:
/usr/src/nginx-http-flv-module/ngx_rtmp_upstream.c:1990:37: error: variable ‘pid’ set but not used [-Werror=unused-but-set-variable]
ngx_pid_t pid;

Many thanks for your work!

Well done, many thanks too! You help me to optimize codes that may lead to error on other platforms:)