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

‘is’ may be used uninitialized [-Werror=maybe-uninitialized] #3049

Closed
Lassebq opened this issue Jan 15, 2024 · 4 comments
Closed

‘is’ may be used uninitialized [-Werror=maybe-uninitialized] #3049

Lassebq opened this issue Jan 15, 2024 · 4 comments

Comments

@Lassebq
Copy link

Lassebq commented Jan 15, 2024

[  0%] Building C object lib/CMakeFiles/websockets.dir/roles/http/server/server.c.o
/home/lassebq/Stuff/git/arrpc-c/libwebsockets/lib/roles/http/server/server.c: In function ‘_lws_vhost_init_server_af’:
/home/lassebq/Stuff/git/arrpc-c/libwebsockets/lib/roles/http/server/server.c:337:47: error: ‘is’ may be used uninitialized [-Werror=maybe-uninitialized]
  337 |                         a->vhost->listen_port = is;
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~
/home/lassebq/Stuff/git/arrpc-c/libwebsockets/lib/roles/http/server/server.c:96:20: note: ‘is’ was declared here
   96 |         int m = 0, is;
      |                    ^~
cc1: all warnings being treated as errors
make[3]: *** [lib/CMakeFiles/websockets.dir/build.make:1294: lib/CMakeFiles/websockets.dir/roles/http/server/server.c.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:3924: lib/CMakeFiles/websockets.dir/all] Error 2
make[1]: *** [Makefile:166: all] Error 2
make[1]: Leaving directory '/media/Stuff/git/arrpc-c/libwebsockets/build'
make: *** [Makefile:3: lws] Error 2
lws:
	mkdir -p libwebsockets/build
	cd libwebsockets/build && cmake -DCMAKE_BUILD_TYPE=Release .. && make
gcc (GCC) 13.2.1 20230801
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@Lassebq
Copy link
Author

Lassebq commented Jan 15, 2024

Seems to work when building manually, makefile from my project doesn't work for some reason

lws-team added a commit that referenced this issue Jan 15, 2024
@lws-team
Copy link
Member

Not sure the warning is not a false positive in practice. But I can also see there's room for it to get confused, I pushed a small patch on main zeroing is.

@Lassebq
Copy link
Author

Lassebq commented Jan 15, 2024

lws:
	mkdir -p libwebsockets/build
	cd libwebsockets/build
	cmake -B libwebsockets/build -S libwebsockets
	make -C libwebsockets/build

This makefile works. I don't know what was happening with a one-liner

@Lassebq Lassebq closed this as completed Jan 15, 2024
lws-team added a commit that referenced this issue Jan 15, 2024
@Lassebq
Copy link
Author

Lassebq commented Jan 15, 2024

-DCMAKE_BUILD_TYPE=Release was the issue it seems.

lws-team added a commit that referenced this issue Jan 16, 2024
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

2 participants