Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Neven Sajko <nsajko@gmail.com>, gdb@sourceware.org
Subject: Re: Printing a 2D array in a C program
Date: Fri, 04 Mar 2016 18:59:00 -0000	[thread overview]
Message-ID: <20160304185904.GA17723@host1.jankratochvil.net> (raw)
In-Reply-To: <56D9D2D3.4020706@redhat.com>

On Fri, 04 Mar 2016 19:24:19 +0100, Pedro Alves wrote:
> It's a C gotcha, but I don't think it's a bug.  Essentially, a parameter
> declared as an array is really treated as a pointer parameter.

I did not look it up but I expected the standard probably says something like
that, this is also why clang matches the gcc behavior.  But GDB could try to
be more helpful displaying the data.  For example DWARF could have the pointer
there at its type for sizeof and similar but additionally there could be some
new GNU attribute for printing the data.

Just I did not file it as I think C++ is more appropriate for such (or all)
cases where it already just works.


Jan


  reply	other threads:[~2016-03-04 18:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 14:27 Neven Sajko
2016-03-04 14:42 ` Jan Kratochvil
2016-03-04 16:15   ` Neven Sajko
2016-03-04 17:49     ` Jan Kratochvil
2016-03-04 18:24       ` Pedro Alves
2016-03-04 18:59         ` Jan Kratochvil [this message]
2016-03-04 19:16           ` Pedro Alves
2016-03-04 18:34     ` Andreas Schwab
2016-03-04 21:48       ` Neven Sajko
2016-03-04 22:16         ` Andreas Schwab
2016-03-05  0:59           ` Neven Sajko
2016-03-05  8:23             ` Andreas Schwab

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=20160304185904.GA17723@host1.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb@sourceware.org \
    --cc=nsajko@gmail.com \
    --cc=palves@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