* decl.c (grokfndecl): Require that `main' return an `int'.
* mangle.c (write_encoding): Don't mangle return types for
conversion functions.
From-SVN: r35972
+2000-08-25 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (grokfndecl): Require that `main' return an `int'.
+ * mangle.c (write_encoding): Don't mangle return types for
+ conversion functions.
+
2000-08-25 Gabriel Dos Reis <gdr@codesourcery.com>
* error.c (tree_formatting_info): New data type.
error ("cannot declare `::main' to be a template");
if (inlinep)
error ("cannot declare `::main' to be inline");
- else if (! publicp)
+ if (!publicp)
error ("cannot declare `::main' to be static");
+ if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),
+ integer_type_node))
+ error ("`main' must return `int'");
inlinep = 0;
publicp = 1;
}
write_bare_function_type (fn_type,
(!DECL_CONSTRUCTOR_P (decl)
&& !DECL_DESTRUCTOR_P (decl)
+ && !DECL_CONV_FN_P (decl)
&& decl_is_template_id (decl, NULL)));
}
}
--- /dev/null
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+double main () {} // ERROR - main must return `int'