alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.65k stars 326 forks source link

[Bug]: Failed to build xquic main branch with GCC 12.1.1 And Clang13.1.6 #220

Closed jiangzw closed 1 year ago

jiangzw commented 1 year ago

What happened?

Failed to build xquic in the following platform and compilers:

Output errors:

xquic/src/transport/xqc_packet_parser.c:996:25: error: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
    if (retry_token_len > XQC_MAX_TOKEN_LEN) {
        ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/xquic-static.dir/src/transport/xqc_packet_parser.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
xquic/src/transport/xqc_engine.c:1048:19: error: comparison of array 'conn->peer_addr' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
        && (conn->peer_addr != NULL && conn->peer_addrlen != 0)
            ~~~~~~^~~~~~~~~    ~~~~
1 error generated.
make[2]: *** [CMakeFiles/xquic-static.dir/src/transport/xqc_engine.c.o] Error 1
xquic/src/transport/xqc_packet_parser.c:996:25: error: result of comparison of constant 256 with expression of type 'uint8_t' (aka 'unsigned char') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
    if (retry_token_len > XQC_MAX_TOKEN_LEN) {
        ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [CMakeFiles/xquic.dir/src/transport/xqc_packet_parser.c.o] Error 1
make[2]: *** Waiting for unfinished jobs....
xquic/src/transport/xqc_engine.c:1048:19: error: comparison of array 'conn->peer_addr' not equal to a null pointer is always true [-Werror,-Wtautological-pointer-compare]
        && (conn->peer_addr != NULL && conn->peer_addrlen != 0)
            ~~~~~~^~~~~~~~~    ~~~~

Steps To Reproduce

make

Relevant log output

No response