Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings with recent compilers clang 19 #2103

Open
shikokuchuo opened this issue Feb 17, 2025 · 0 comments
Open

Warnings with recent compilers clang 19 #2103

shikokuchuo opened this issue Feb 17, 2025 · 0 comments

Comments

@shikokuchuo
Copy link
Contributor

Describe the bug

Recent updates to compiler versions unearth the following warnings:

  1. 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]

  2. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant