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

warning: 'unique_ipaddr' may be used uninitialized #2064

Closed
lmoureaux opened this issue Nov 27, 2023 · 0 comments · Fixed by #2065
Closed

warning: 'unique_ipaddr' may be used uninitialized #2064

lmoureaux opened this issue Nov 27, 2023 · 0 comments · Fixed by #2065
Assignees
Labels
bug Something isn't working server This issue requires changes to the server

Comments

@lmoureaux
Copy link
Contributor

Describe the bug

Spotted on msys2:

[399/509] Building CXX object server/CMakeFiles/server.dir/stdinhand.cpp.obj
D:/a/freeciv21/freeciv21/server/stdinhand.cpp: In function 'bool kick_command(connection*, char*, bool)':
D:/a/freeciv21/freeciv21/server/stdinhand.cpp:6349:24: warning: 'unique_ipaddr' may be used uninitialized [-Wmaybe-uninitialized]
 6349 |         if (0 == strcmp(unique_ipaddr[i], aconn->server.ipaddr)) {
      |                  ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/a/freeciv21/freeciv21/server/stdinhand.cpp:6338:17: note: 'unique_ipaddr' declared here
 6338 |     const char *unique_ipaddr[MIN_UNIQUE_CONNS];
      |                 ^~~~~~~~~~~~~

Link to CI build

@lmoureaux lmoureaux added bug Something isn't working server This issue requires changes to the server labels Nov 27, 2023
@lmoureaux lmoureaux self-assigned this Nov 27, 2023
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 27, 2023
There was a warning that a variable may have been used initialized. This was
likely not the case, but since the implementation was convoluted I used the
opportunity to simplify it.

Closes longturn#2064.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this issue Nov 27, 2023
There was a warning that a variable may have been used initialized. This was
likely not the case, but since the implementation was convoluted I used the
opportunity to simplify it.

Closes longturn#2064.
lmoureaux added a commit that referenced this issue Nov 27, 2023
There was a warning that a variable may have been used initialized. This was
likely not the case, but since the implementation was convoluted I used the
opportunity to simplify it.

Closes #2064.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server This issue requires changes to the server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant