Skip to content

Conversation

chucklever
Copy link
Member

Add a simple "static analysis" Action. This can be extended over time with more heavyweight analysis tools.

Static checkers are having some difficulty finding the autoconf-
generated config.h header.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/client.c:174:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int i, ret;
        ^

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/handshake.c:67:3: warning: Assignment of function parameter has no effect outside the function. Did you forget dereferencing it? [uselessAssignmentPtrArg]
  saved = 0;
  ^
src/tlshd/handshake.c:67:9: style: Variable 'saved' is assigned a value that is never used. [unreadVariable]
  saved = 0;
        ^

Fixes: d1e8717 ("tlshd: Disable Nagle during handshakes on TCP sockets")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/ktls.c:543:40: style: Parameter 'parms' can be declared as pointer to const [constParameterPointer]
     struct tlshd_handshake_parms *parms,

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/main.c:59:25: style: Parameter 'progname' can be declared as pointer to const [constParameterPointer]
static void usage(char *progname)
                        ^

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/netlink.c:483:6: style: The scope of the variable 'err' can be reduced. [variableScope]
 int err;
     ^
src/tlshd/netlink.c:287:8: style: Variable 'peername' can be declared as pointer to const [constVariablePointer]
 char *peername = NULL;
       ^
src/tlshd/netlink.c:394:19: style: Variable 'hdr' can be declared as pointer to const [constVariablePointer]
 struct nlmsghdr *hdr;
                  ^
src/tlshd/netlink.c:503:19: style: Variable 'hdr' can be declared as pointer to const [constVariablePointer]
 struct nlmsghdr *hdr;
                  ^

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/quic.c:110:14: style: The scope of the variable 'ret' can be reduced. [variableScope]
 int sockfd, ret, len = sizeof(secret);
             ^
src/tlshd/quic.c:387:61: style: Parameter 'conn' can be declared as pointer to const [constParameterPointer]
static int quic_handshake_completed(struct tlshd_quic_conn *conn)
                                                            ^
src/tlshd/quic.c:392:63: style: Parameter 'conn' can be declared as pointer to const [constParameterPointer]
static int quic_handshake_crypto_data(struct tlshd_quic_conn *conn, uint8_t level,
                                                              ^

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
src/tlshd/server.c:84:9: style: The scope of the variable 'ret' can be reduced. [variableScope]
  int i, ret;
         ^
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Start with a Cppchecker job. More can be added.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
@chucklever chucklever merged commit 41ea1d4 into main Sep 1, 2025
12 checks passed
@chucklever chucklever deleted the workflow-updates branch September 1, 2025 15:36
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