This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA: print prototyped function types with no arguments correctly
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Sat, 9 Feb 2002 02:01:10 -0500 (EST)
- Subject: RFA: print prototyped function types with no arguments correctly
Pretty obvious. I'm just waiting to re-run the test suite before I
commit this.
2002-02-08 Jim Blandy <jimb@redhat.com>
* c-typeprint.c (c_type_print_varspec_suffix): If a function type
is prototyped and has no arguments, print its argument list as
`(void)'.
Index: gdb/c-typeprint.c
===================================================================
RCS file: /cvs/src/src/gdb/c-typeprint.c,v
retrieving revision 1.17
diff -c -r1.17 c-typeprint.c
*** gdb/c-typeprint.c 2002/01/20 19:42:04 1.17
--- gdb/c-typeprint.c 2002/02/09 06:54:28
***************
*** 576,582 ****
{
int i, len = TYPE_NFIELDS (type);
fprintf_filtered (stream, "(");
! if ((len == 0) && (current_language->la_language == language_cplus))
{
fprintf_filtered (stream, "void");
}
--- 576,584 ----
{
int i, len = TYPE_NFIELDS (type);
fprintf_filtered (stream, "(");
! if (len == 0
! && (TYPE_PROTOTYPED (type)
! || current_language->la_language == language_cplus))
{
fprintf_filtered (stream, "void");
}