* c-typeprint.c (c_type_print_varspec_suffix): If a function type

is prototyped and has no arguments, print its argument list as
`(void)'.
This commit is contained in:
Jim Blandy
2002-02-09 16:08:53 +00:00
parent 51124b6cb9
commit bdc2fc72b3
2 changed files with 9 additions and 1 deletions

View 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");
}