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 compiler warning "function may return address of local variable" #752

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

sivar2311
Copy link
Contributor

WebSocketsServer.cpp: In member function 'WSclient_t* WebSocketsServerCore::handleNewClient(WiFiClient*)':
WebSocketsServer.cpp:634:12: warning: function may return address of local variable [-Wreturn-local-addr]
     return client;
            ^~~~~~
WebSocketsServer.cpp:626:20: note: declared here
         WSclient_t dummy = WSclient_t();

If the check in line 615 is true, the address of a local variable is returned.
This commit prevents this and thus avoids the compiler warning.

@sivar2311
Copy link
Contributor Author

Hi @Links2004!
Is there anything wrong with the PR or is there something else I need to do?

@Links2004 Links2004 merged commit 3073c15 into Links2004:master Jun 24, 2022
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.

None yet

2 participants