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

thread: fix gcc warnings #1078

Closed
wants to merge 3 commits into from
Closed

thread: fix gcc warnings #1078

wants to merge 3 commits into from

Conversation

jobo-zt
Copy link
Contributor

@jobo-zt jobo-zt commented Mar 8, 2024

warning: cast from function call of type ‘int’ to non-matching type ‘void *’ [-Wbad-function-cast]

warning: cast from function call of type ‘int’ to non-matching type ‘void *’ [-Wbad-function-cast]
@jobo-zt jobo-zt closed this Mar 8, 2024
@jobo-zt jobo-zt reopened this Mar 8, 2024
@sreimers
Copy link
Member

sreimers commented Mar 12, 2024

Which cppcheck version/flags do you use? With v2.12.0 I can not reproduce this.

@sreimers sreimers marked this pull request as draft March 12, 2024 09:26
@alfredh
Copy link
Contributor

alfredh commented Mar 13, 2024

here is output from cppcheck 2.13

src/base64/b64.c:35:29: warning: Either the condition '!in' is redundant or there is pointer arithmetic with NULL pointer. [nullPointerArithmeticRedundantCheck]
 const uint8_t *in_end = in + ilen;
                            ^
src/base64/b64.c:38:6: note: Assuming that condition '!in' is not redundant
 if (!in || !out || !olen)
     ^
src/base64/b64.c:35:29: note: Null pointer addition
 const uint8_t *in_end = in + ilen;
                            ^
src/net/win32/wif.c:102:17: warning: Uninitialized variable: p [uninitvar]
 for (p = info; p; p = p->Next) {
                ^
src/net/win32/wif.c:92:23: note: Assignment 'p=info', assigned value is <Uninit>
 PIP_ADAPTER_INFO p = info;
                      ^
src/net/win32/wif.c:97:10: note: Assuming condition is false
 if (ret != ERROR_SUCCESS) {
         ^
src/net/win32/wif.c:102:17: note: Uninitialized variable: p
 for (p = info; p; p = p->Next) {
                ^
src/sipevent/sipevent.h:51:39: error: syntax error [syntaxError]
void sipnot_refresh(struct sipnot *not, uint32_t expires);

@jobo-zt
Copy link
Contributor Author

jobo-zt commented Mar 14, 2024

I used gcc version 10.2.1 20210110 (Debian 10.2.1-6) In the Raspberry Pi to report this errors . not cppcheck

@alfredh
Copy link
Contributor

alfredh commented Mar 16, 2024

The current code is legal and valid.

I think it is just gcc that is a bit difficult regarding this code ...

@alfredh alfredh changed the title thread: fix cppcheck warnings thread: fix gcc warnings Mar 26, 2024
@sreimers
Copy link
Member

Replaced by: #1093

@sreimers sreimers closed this Mar 27, 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

Successfully merging this pull request may close these issues.

3 participants