From: Hannes Domani <ssbssa@yahoo.de>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Guinevere Larsen <blarsen@redhat.com>
Cc: Keith Seitz <keiths@redhat.com>
Subject: Re: [PATCH] Fix comparison of array types
Date: Sun, 17 Mar 2024 14:12:45 +0000 (UTC) [thread overview]
Message-ID: <1491730163.8675235.1710684765346@mail.yahoo.com> (raw)
In-Reply-To: <4b9a274e-f072-4408-b797-857573a96b11@redhat.com>
Am Donnerstag, 29. Februar 2024 um 14:26:16 MEZ hat Guinevere Larsen <blarsen@redhat.com> Folgendes geschrieben:
> On 09/02/2024 20:45, Hannes Domani wrote:
> > Currently it's not possible to call functions if an argument is a
> > pointer to an array:
> > ```
> > (gdb) l f
> > 1 int f (int (*x)[2])
> > 2 {
> > 3 return x[0][1];
> > 4 }
> > 5
> > 6 int main()
> > 7 {
> > 8 int a[2][2] = {{0, 1}, {2, 3}};
> > 9 return f (a);
> > 10 }
> > (gdb) p f(a)
> > Cannot resolve function f to any overloaded instance
> > ```
> >
> > This happens because types_equal doesn't handle array types, so the
> > function is never even considered as a possibility.
> >
> > With array type handling added, by comparing element types and array
> > bounds, the same works:
> > ```
> > (gdb) p f(a)
> > $1 = 1
> > ```
> >
> > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=15398
> > Co-Authored-By: Keith Seitz <keiths@redhat.com>
>
> Hi!
>
> This patch fixes the problem (for both gcc and clang) and introduces no
> regressions.
>
> My one nitpick is that I think this code fits more naturally right after
> the pointer check, instead of the last check in the function, but feel
> free to disagree. Either way: Reviewed-By: Guinevere Larsen
> <blarsen@redhat.com>
Either position is fine for me.
Hannes
next prev parent reply other threads:[~2024-03-17 14:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20240209194545.31497-1-ssbssa.ref@yahoo.de>
2024-02-09 19:45 ` Hannes Domani
2024-02-25 12:02 ` Hannes Domani
2024-02-29 13:26 ` Guinevere Larsen
2024-03-17 14:12 ` Hannes Domani [this message]
2024-03-18 16:26 ` Tom Tromey
2024-03-18 16:20 ` Tom Tromey
2024-03-20 15:46 ` Hannes Domani
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=1491730163.8675235.1710684765346@mail.yahoo.com \
--to=ssbssa@yahoo.de \
--cc=blarsen@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=keiths@redhat.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).