Description
Describe the bug
Recent updates to compiler versions unearth the following warnings:
-
http_server.c
warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations] -
aio.c
runtime error: call to function nni_aio_free through pointer to incorrect function type 'void (*)(void *)'
UndefinedBehaviorSanitizer: undefined-behavior
Solution
(1) You've already fixed in main, would be great to port this to stable.
(2) The cast of nni_aio_free()
to type nni_cb
is technically UB here: https://github.com/nanomsg/nng/blob/main/src/core/aio.c#L77
I will provide a PR for both of the above.
** Environment Details **
- NNG version 1.10.1
- Operating system and version: Ubuntu 22
- Compiler and language used: clang 19.1.7 with ASAN/UBSAN
- Static library
Activity