This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Printing a 2D array in a C program


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]