alibaba / xquic

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

[Bug]: compile error on macos #107

Closed Kulsk closed 2 years ago

Kulsk commented 2 years ago

What happened?

printf type error:

/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_request.c:183:60: error: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat] PRINT_LOG("|send req error|ret:%"PRId64"", ret);


/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_defs.h:25:85: note: expanded from macro 'PRINT_LOG'
#define PRINT_LOG(format, ...) printf("%s|%d|"format"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
                                              ~~~~~~                                ^~~~~~~~~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_request.c:216:58: error: format specifies type 'unsigned long long' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat]
        PRINT_LOG("|send request error|ret: %"PRIu64"|", ret);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_defs.h:25:85: note: expanded from macro 'PRINT_LOG'
#define PRINT_LOG(format, ...) printf("%s|%d|"format"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
                                              ~~~~~~                                ^~~~~~~~~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_request.c:271:60: error: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat]
            PRINT_LOG("|xqc_stream_recv error %"PRId64"|", read);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_defs.h:25:85: note: expanded from macro 'PRINT_LOG'
#define PRINT_LOG(format, ...) printf("%s|%d|"format"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
                                              ~~~~~~                                ^~~~~~~~~~~
3 errors generated.
make[2]: *** [CMakeFiles/demo_server.dir/demo/xqc_hq_request.c.o] Error 1
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_request.c:183:60: error: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat]
                PRINT_LOG("|send req error|ret:%"PRId64"", ret);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_defs.h:25:85: note: expanded from macro 'PRINT_LOG'
#define PRINT_LOG(format, ...) printf("%s|%d|"format"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
                                              ~~~~~~                                ^~~~~~~~~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_request.c:216:58: error: format specifies type 'unsigned long long' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat]
        PRINT_LOG("|send request error|ret: %"PRIu64"|", ret);
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_defs.h:25:85: note: expanded from macro 'PRINT_LOG'
#define PRINT_LOG(format, ...) printf("%s|%d|"format"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
                                              ~~~~~~                                ^~~~~~~~~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_request.c:271:60: error: format specifies type 'long long' but the argument has type 'ssize_t' (aka 'long') [-Werror,-Wformat]
            PRINT_LOG("|xqc_stream_recv error %"PRId64"|", read);
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/Users/leg/Documents/GitHub/xquic/demo/xqc_hq_defs.h:25:85: note: expanded from macro 'PRINT_LOG'
#define PRINT_LOG(format, ...) printf("%s|%d|"format"\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
                                              ~~~~~~                                ^~~~~~~~~~~

### Steps To Reproduce

make on macos

### Relevant log output

_No response_