Opened 4 years ago

Closed 4 years ago

Last modified 19 months ago

#2104 closed defect (fixed)

I encountered an error when compiling nginx-quic.

Reported by: yiguihai@… Owned by:
Priority: minor Milestone:
Component: nginx-package Version:
Keywords: nginx-quic Cc:
uname -a:
nginx -V: nginx-quic

Description

src/event/ngx_event_quic_transport.c: In function ‘ngx_quic_create_stream’:
src/event/ngx_event_quic_transport.c:60:27: error: comparison is always true due to limited range of data type [-Werror=type-limits]
      : ((uint32_t) value) <= 16383 ? 2                                        \
                           ^
src/event/ngx_event_quic_transport.c:1376:15: note: in expansion of macro ‘ngx_quic_varint_len’
         len = ngx_quic_varint_len(sf->type);
               ^
src/event/ngx_event_quic_transport.c:61:27: error: comparison is always true due to limited range of data type [-Werror=type-limits]
      : ((uint64_t) value) <= 1073741823 ?  4                                  \
                           ^
src/event/ngx_event_quic_transport.c:1376:15: note: in expansion of macro ‘ngx_quic_varint_len’
         len = ngx_quic_varint_len(sf->type);
               ^
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g -I/tmp/boringssl/include -I src/core -I src/event -I src/event/modules -I src/os/unix -I /tmp/libpcre -I /tmp/zlib -I objs \
	-o objs/src/event/ngx_event_quic_protection.o \
	src/event/ngx_event_quic_protection.c
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_quic_transport.o] Error 1
objs/Makefile:1015: recipe for target 'objs/src/event/ngx_event_quic_transport.o' failed
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/runner/work/shadowsocks_install/shadowsocks_install/nginx-quic-quic'
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 2
Error: Process completed with exit code 2.

Here is a link to the detailed error message
https://github.com/yiguihai/shadowsocks_install/runs/1494348970?check_suite_focus=true#step:13:835

Change History (7)

comment:1 by Sergey Kandaurov, 4 years ago

What is the nginx-quic revision?
What is a compiler and its version?

comment:2 by yiguihai@…, 4 years ago

I don't know what version of nginx-quic is supposed to be the latest version.
This is the address of the source code package I downloaded.
https://hg.nginx.org/nginx-quic/archive/quic.tar.gz

ubuntu-16.04
x86_64-unknown-linux-gnu
gcc 5.04

comment:3 by yiguihai@…, 4 years ago

I made a typo in the gcc version and need to correct it.
built by gcc 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1~16.04)
Linux 4.15.0-1098-azure x86_64

comment:4 by Sergey Kandaurov, 4 years ago

Yes, this is a known issue when compiling with gcc5.
It is believed to be a defect in the compiler,
because newer gcc versions do not produce such an error.

As a workaround, you can build nginx-quic with -Wno-error=type-limits:
Add this gcc options to --with-cc-opt as follows:
--with-cc-opt='-Wno-error=type-limits'

comment:5 by yiguihai@…, 4 years ago

Thank you for your helpfulness in helping me finally compile it!👍
Already compiled and approved

comment:6 by Sergey Kandaurov, 4 years ago

Resolution: fixed
Status: newclosed

comment:7 by Sergey Kandaurov <pluknet@…>, 19 months ago

In 8671:5247461c17e1/nginx:

QUIC: fixed -Wtype-limits with GCC <= 5 (ticket #2104).

Note: See TracTickets for help on using tickets.