Closed LanYunDev closed 3 weeks ago
not big problem. It's not always worth the time to fix all those warnings IMO.
see also what libev author says.
nevertheless, I will try clear up some easy warnings when I have the free time.
Thanks for the answers!
UDPspeeder/common.cpp: In member function 'char address_t::get_str()': UDPspeeder/common.cpp:312:24: warning: '%u' directive writing between 1 and 5 bytes into a region of size between 0 and 99 [-Wformat-overflow=] 312 | sprintf(s, "%s:%u", ip_addr, (u32_t)port); | ^~ UDPspeeder/common.cpp:312:20: note: directive argument in the range [0, 65535] 312 | sprintf(s, "%s:%u", ip_addr, (u32_t)port); | ^
~~ UDPspeeder/common.cpp:312:16: note: 'sprintf' output between 3 and 106 bytes into a destination of size 100 312 | sprintf(s, "%s:%u", ip_addr, (u32_t)port); |~^~~~~~~~ UDPspeeder/common.cpp:310:24: warning: ']:' directive writing 2 bytes into a region of size between 0 and 99 [-Wformat-overflow=] 310 | sprintf(s, "[%s]:%u", ip_addr, (u32_t)port); | ^~ UDPspeeder/common.cpp:310:20: note: directive argument in the range [0, 65535] 310 | sprintf(s, "[%s]:%u", ip_addr, (u32_t)port); | ^~~~~ UDPspeeder/common.cpp:310:16: note: 'sprintf' output between 5 and 108 bytes into a destination of size 100 310 | sprintf(s, "[%s]:%u", ip_addr, (u32_t)port); |~^~~~~~~~~~ main.cpp: In function 'void print_help()': main.cpp:17:12: warning: 'char strncpy(char, const char, size_t)' output truncated copying 10 bytes from a string of length 40 [-Wstringop-truncation] 17 | strncpy(git_version_buf, gitversion, 10); |~^~~~~~~