Index: src/CodeGen/FixMain.cc
===================================================================
--- src/CodeGen/FixMain.cc	(revision 90449e42a47322a4321a4a214fa9a76e57f61409)
+++ src/CodeGen/FixMain.cc	(revision 1619acd5ad23c53dd53ac9d62878d1d11644638c)
@@ -23,4 +23,5 @@
 
 #include "Common/SemanticError.h"  // for SemanticError
+#include "CodeGen/GenType.h"       // for GenType
 #include "SynTree/Declaration.h"   // for FunctionDecl, operator<<
 #include "SynTree/Type.h"          // for FunctionType
@@ -29,4 +30,9 @@
 	bool FixMain::replace_main = false;
 	std::unique_ptr<FunctionDecl> FixMain::main_signature = nullptr;
+
+	template<typename container>
+	std::string genTypeAt(const container& p, size_t idx) {
+		return genType((*std::next(p.begin(), idx))->get_type(), "");
+	}
 
 	void FixMain::registerMain(FunctionDecl* functionDecl)
@@ -43,7 +49,8 @@
 
 			os << main_signature->get_scopedMangleName() << "(";
-			switch(main_signature->get_functionType()->get_parameters().size()) {
-				case 3: os << "argc, argv, envp"; break;
-				case 2: os << "argc, argv"; break;
+			const auto& params = main_signature->get_functionType()->get_parameters();
+			switch(params.size()) {
+				case 3: os << "(" << genTypeAt(params, 0) << ")argc, (" << genTypeAt(params, 1) << ")argv, (" << genTypeAt(params, 2) << ")envp"; break;
+				case 2: os << "(" << genTypeAt(params, 0) << ")argc, (" << genTypeAt(params, 1) << ")argv"; break;
 				case 0: break;
 				default : assert(false);
