public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	Tom de Vries <tdevries@suse.de>,
	gdb-patches@sourceware.org
Subject: Re: [PATCH] [gdb/build] Fix static cast of virtual base
Date: Tue, 19 Mar 2024 14:58:25 +0000	[thread overview]
Message-ID: <87v85itgj2.fsf@redhat.com> (raw)
In-Reply-To: <7f3d74e0-1825-477d-9842-1d7f7fce221a@polymtl.ca>

Simon Marchi <simon.marchi@polymtl.ca> writes:

> On 3/11/24 06:25, Andrew Burgess wrote:
>>> This is similar to what I proposed here:
>>>
>>> https://inbox.sourceware.org/gdb-patches/24af4ea8-5426-4ce4-b1c5-12858b38a952@simark.ca/
>>>
>>> The idea is the same, to have a static_cast in the DEVELOPMENT branch.
>>> I kinda like my version better, as it factors out the static cast
>>> (notice that both branches have identical static_cast lines after your
>>> patch) and the  ifdef is just around a single assert.  Also, I'm pretty
>>> sure the nullptr check is not necessary, as both dynamic_cast and
>>> static_cast can handle it.
>> 
>> I agree yours is better.  Do you have an official patch somewhere that I
>> can add a +1 too?  If not then below is an updated version inline with
>> you proposal.  Feel free to push your version if you have it somewhere.
>
> I didn't have a proper patch ready, what you sent LGTM.  Thanks a lot
> for taking care of it.

Thanks.  I pushed this patch.

I also pushed the patch below which I spotted in the same area.

Thanks,
Andrew

---

commit 8695c3a693849bf6ebd3c6d0620f03bcc6429604
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Wed Mar 6 17:48:55 2024 +0000

    gdbsupport: rename include guard in gdb-checked-static-cast.h
    
    I noticed in passing that the include guard in the file
    gdbsupport/gdb-checked-static-cast.h was wrong, it includes the word
    DYNAMIC when STATIC would be better, fixed in this commit.
    
    There should be no user visible changes after this commit.

diff --git a/gdbsupport/gdb-checked-static-cast.h b/gdbsupport/gdb-checked-static-cast.h
index 24fa7a4ba04..97843fab225 100644
--- a/gdbsupport/gdb-checked-static-cast.h
+++ b/gdbsupport/gdb-checked-static-cast.h
@@ -15,8 +15,8 @@
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
-#ifndef COMMON_GDB_CHECKED_DYNAMIC_CAST_H
-#define COMMON_GDB_CHECKED_DYNAMIC_CAST_H
+#ifndef COMMON_GDB_CHECKED_STATIC_CAST_H
+#define COMMON_GDB_CHECKED_STATIC_CAST_H
 
 #include "gdbsupport/traits.h"
 
@@ -80,4 +80,4 @@ checked_static_cast (V &v)
 
 }
 
-#endif /* COMMON_GDB_CHECKED_DYNAMIC_CAST_H */
+#endif /* COMMON_GDB_CHECKED_STATIC_CAST_H */


      reply	other threads:[~2024-03-19 14:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 16:18 Tom de Vries
2024-02-23 13:56 ` Tom Tromey
2024-03-06 17:39 ` Andrew Burgess
2024-03-06 18:27   ` Simon Marchi
2024-03-08 16:18     ` Tom Tromey
2024-03-11 10:25     ` Andrew Burgess
2024-03-11 16:22       ` Simon Marchi
2024-03-19 14:58         ` Andrew Burgess [this message]

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=87v85itgj2.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@polymtl.ca \
    --cc=tdevries@suse.de \
    /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).