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

Fix deprecated warning in facil.io #154

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vctrmn
Copy link

@vctrmn vctrmn commented Mar 3, 2025

This PR fixes a compiler warning in the websockets.c file regarding a deprecated non-prototype function declaration. The warning occurs because the new_websocket function is initially declared without a prototype but is later defined with a parameter.

The warning looks like this:

facil.io/lib/facil/http/websockets.c:99:14: warning: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting with a subsequent definition [-Wdeprecated-non-prototype]
   99 | static ws_s *new_websocket();
      |              ^
facil.io/lib/facil/http/websockets.c:305:14: note: conflicting prototype is here
  305 | static ws_s *new_websocket(intptr_t uuid) {
      |              ^

I encountered this issue while integrating Zap as a zig library in a zig / bazel project (see : https://github.com/vctrmn/zig-text-embeddings-inference)

If you are interested into this topic, I can also upload the BUILD.bazel to showcase how to integrate it.

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

Successfully merging this pull request may close these issues.

1 participant