From: "Cole Helbling" <cole.e.helbling@outlook.com>
To: "Alyssa Ross" <hi@alyssa.is>, <devel@spectrum-os.org>
Cc: Cole Helbling <cole.e.helbling@outlook.com>
Subject: Re: [PATCH ucspi-vsock 0/2] Fix clang-tidy warnings
Date: Sun, 21 Mar 2021 09:30:42 -0700 [thread overview]
Message-ID: <SJ0PR03MB558115DAF13AB67117883B55B3669@SJ0PR03MB5581.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20210321144700.24024-1-hi@alyssa.is>
On Sun Mar 21, 2021 at 7:46 AM PDT, Alyssa Ross wrote:
> clang-tidy also produced this warning:
>
> /home/src/ucspi-vsock/repro.c:43:19: warning: unused parameter 'sig' [clang-diagnostic-unused-parameter]
> void sig_exit(int sig) { exit(EX_UNAVAILABLE); }
> ^
> vsock.c:27:23: warning: The left operand of '!=' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
> if (addr->svm_family != AF_VSOCK) {
> ^
> vsock.c:90:6: note: Assuming the condition is false
> if (getsockname(fd, (struct sockaddr *)&addr, &addrlen) == -1)
> ^
> vsock.c:90:2: note: Taking false branch
> if (getsockname(fd, (struct sockaddr *)&addr, &addrlen) == -1)
> ^
> vsock.c:93:9: note: Calling 'fill_cid_and_port'
> return fill_cid_and_port(&addr, cid, port);
> ^
> vsock.c:27:23: note: The left operand of '!=' is a garbage value
> if (addr->svm_family != AF_VSOCK) {
>
> But I think this is just warning me that the POSIX socket API violates
> the strict aliasing rule. (Which is true, but there's not a lot I can
> do about it...)
>
> It also tells me I should use memset_s instead of memset, but, well...
> https://en.wikipedia.org/wiki/C11_(C_standard_revision)#Criticism
>
> Alyssa Ross (2):
> exec: free argv if exec fails
> vsockserver: fix uninitialized variable
>
> exec.c | 5 ++++-
> vsockserver.c | 2 +-
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> --
> 2.30.0
Patchset LGTM.
Reviewed-by: Cole Helbling <cole.e.helbling@outlook.com>
(I should really make a macro or something for that ^, so I don't have
to type it out every time and potentially make a mistake :D)
next prev parent reply other threads:[~2021-03-21 16:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-21 14:46 [PATCH ucspi-vsock 0/2] Fix clang-tidy warnings Alyssa Ross
2021-03-21 14:51 ` [PATCH ucspi-vsock 1/2] exec: free argv if exec fails Alyssa Ross
2021-03-21 14:54 ` [PATCH ucspi-vsock 2/2] vsockserver: fix uninitialized variable Alyssa Ross
2021-03-21 16:30 ` Cole Helbling [this message]
2021-03-21 19:37 ` [PATCH ucspi-vsock 0/2] Fix clang-tidy warnings Alyssa Ross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SJ0PR03MB558115DAF13AB67117883B55B3669@SJ0PR03MB5581.namprd03.prod.outlook.com \
--to=cole.e.helbling@outlook.com \
--cc=devel@spectrum-os.org \
--cc=hi@alyssa.is \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://spectrum-os.org/git/crosvm
https://spectrum-os.org/git/doc
https://spectrum-os.org/git/mktuntap
https://spectrum-os.org/git/nixpkgs
https://spectrum-os.org/git/spectrum
https://spectrum-os.org/git/ucspi-vsock
https://spectrum-os.org/git/www
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).