This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: 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: 09 Feb 2002 11:12:35 -0500
- Subject: Re: RFA: print prototyped function types with no arguments correctly
- References: <20020209070110.C378B5E9DE@zwingli.cygnus.com>
No regressions, so I've committed this.
Jim Blandy <jimb@cygnus.com> writes:
> 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");
> }