* c-typeprint.c (c_type_print_varspec_suffix): If a function type
authorJim Blandy <jimb@codesourcery.com>
Sat, 9 Feb 2002 16:08:53 +0000 (16:08 +0000)
committerJim Blandy <jimb@codesourcery.com>
Sat, 9 Feb 2002 16:08:53 +0000 (16:08 +0000)
is prototyped and has no arguments, print its argument list as
`(void)'.

gdb/ChangeLog
gdb/c-typeprint.c

index 27a4fcf..e469f4c 100644 (file)
@@ -1,3 +1,9 @@
+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)'.
+
 2002-02-08  Chris Demetriou  <cgd@broadcom.com>
 
        * MAINTAINERS (write-after-approval): Add myself.
index e2a9945..0c460e9 100644 (file)
@@ -576,7 +576,9 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream,
        {
          int i, len = TYPE_NFIELDS (type);
          fprintf_filtered (stream, "(");
-         if ((len == 0) && (current_language->la_language == language_cplus))
+         if (len == 0
+              && (TYPE_PROTOTYPED (type)
+                  || current_language->la_language == language_cplus))
            {
              fprintf_filtered (stream, "void");
            }