public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb: cast return value of std::unique_ptr::release to void
Date: Mon, 13 Feb 2023 17:13:42 -0700	[thread overview]
Message-ID: <87pmadcde1.fsf@tromey.com> (raw)
In-Reply-To: <20230213195513.37532-1-simon.marchi@efficios.com> (Simon Marchi via Gdb-patches's message of "Mon, 13 Feb 2023 14:55:13 -0500")

>>>>> "Simon" == Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> writes:

Simon> My editor shows warnings like:
Simon>      value.c:2784: warning: The value returned by this function should be used
Simon>      value.c:2784: note: cast the expression to void to silence this warning [bugprone-unused-return-value]

Simon> These warnings come from clangd, so ultimately from one of the clang
Simon> static analyzers (probably clang-tidy).

Simon> Silence these warnings by casting to void.  Add a comment to explain
Simon> why this unusual thing is done.

Normally I think we should work to get rid of .release() calls.
However this one looks like a pain, probably why it is already there.
And, your patch doesn't make anything worse in this regard.  So as much
as I hate cast to void I think it's ok.

Approved-By: Tom Tromey <tom@tromey.com>

Tom

  reply	other threads:[~2023-02-14  0:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13 19:55 Simon Marchi
2023-02-14  0:13 ` Tom Tromey [this message]
2023-02-14 19:29   ` Simon Marchi
2023-02-15 17:04     ` Tom Tromey

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=87pmadcde1.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).