Re: Printing a 2D array in a C program
Jan Kratochvil <[email protected]>
| Newsgroups | gmane.comp.gdb.devel |
|---|---|
| Message-ID | <[email protected]> |
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