Index: src/Parser/DeclarationNode.cc
===================================================================
--- src/Parser/DeclarationNode.cc	(revision 138e29ecafd7b7c16c01bc5bf07aa51231168aa0)
+++ src/Parser/DeclarationNode.cc	(revision 94ad12f5f91121af7a3b0495b4b3abae9618fdfe)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 12:34:05 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb  9 15:54:59 2017
-// Update Count     : 742
+// Last Modified On : Thu Feb 16 13:06:50 2017
+// Update Count     : 753
 //
 
@@ -913,7 +913,6 @@
 	SemanticError errors;
 	std::back_insert_iterator< std::list< Declaration * > > out( outputList );
-	const DeclarationNode * cur = firstNode;
-
-	while ( cur ) {
+
+	for ( const DeclarationNode * cur = firstNode; cur; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) {
 		try {
 			if ( DeclarationNode * extr = cur->extractAggregate() ) {
@@ -936,5 +935,4 @@
 			errors.append( e );
 		} // try
-		cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
 	} // while
 
@@ -947,6 +945,6 @@
 	SemanticError errors;
 	std::back_insert_iterator< std::list< DeclarationWithType * > > out( outputList );
-	const DeclarationNode * cur = firstNode;
-	while ( cur ) {
+	
+	for ( const DeclarationNode * cur = firstNode; cur; cur = dynamic_cast< DeclarationNode * >( cur->get_next() ) ) {
 		try {
 			Declaration * decl = cur->build();
@@ -972,6 +970,6 @@
 			errors.append( e );
 		} // try
-		cur = dynamic_cast< DeclarationNode * >( cur->get_next() );
-	} // while
+	} // for
+
 	if ( ! errors.isEmpty() ) {
 		throw errors;
Index: src/Parser/ParseNode.h
===================================================================
--- src/Parser/ParseNode.h	(revision 138e29ecafd7b7c16c01bc5bf07aa51231168aa0)
+++ src/Parser/ParseNode.h	(revision 94ad12f5f91121af7a3b0495b4b3abae9618fdfe)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 13:28:16 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb  9 14:45:28 2017
-// Update Count     : 658
+// Last Modified On : Thu Feb 16 13:15:55 2017
+// Update Count     : 661
 //
 
@@ -437,5 +437,5 @@
 template< typename SynTreeType, typename NodeType >
 void buildMoveList( const NodeType * firstNode, std::list< SynTreeType * > &outputList ) {
-	buildList(firstNode, outputList);
+	buildList( firstNode, outputList );
 	delete firstNode;
 }
Index: src/Parser/TypeData.cc
===================================================================
--- src/Parser/TypeData.cc	(revision 138e29ecafd7b7c16c01bc5bf07aa51231168aa0)
+++ src/Parser/TypeData.cc	(revision 94ad12f5f91121af7a3b0495b4b3abae9618fdfe)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:12:51 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Fri Jan 27 15:28:56 2017
-// Update Count     : 428
+// Last Modified On : Thu Feb 16 15:06:59 2017
+// Update Count     : 455
 //
 
@@ -724,4 +724,8 @@
 Declaration * buildDecl( const TypeData * td, const string &name, DeclarationNode::StorageClass sc, Expression * bitfieldWidth, bool isInline, bool isNoreturn, LinkageSpec::Spec linkage, ConstantExpr *asmName, Initializer * init, std::list< Attribute * > attributes ) {
 	if ( td->kind == TypeData::Function ) {
+		if ( td->function.idList ) {
+			buildKRFunction( td->function );
+		} // if
+
 		FunctionDecl * decl;
 		if ( td->function.hasBody ) {
@@ -738,10 +742,4 @@
 			decl = new FunctionDecl( name, sc, linkage, buildFunction( td ), nullptr, isInline, isNoreturn, attributes );
 		} // if
-		for ( DeclarationNode * cur = td->function.idList; cur != nullptr; cur = dynamic_cast< DeclarationNode* >( cur->get_next() ) ) {
-			if ( cur->name ) {
-				decl->get_oldIdents().insert( decl->get_oldIdents().end(), *cur->name );
-			} // if
-		} // for
-		buildList( td->function.oldDeclList, decl->get_oldDecls() );
 		return decl->set_asmName( asmName );
 	} else if ( td->kind == TypeData::Aggregate ) {
@@ -778,4 +776,31 @@
 } // buildFunction
 
+void buildKRFunction( const TypeData::Function_t & function ) {
+	assert( ! function.params );
+	for ( DeclarationNode * decl = function.oldDeclList; decl != nullptr; decl = dynamic_cast< DeclarationNode* >( decl->get_next() ) ) {
+		for ( DeclarationNode * param = function.idList; param != nullptr; param = dynamic_cast< DeclarationNode* >( param->get_next() ) ) {
+			if ( *decl->name == *param->name ) {
+				if ( param->type ) throw SemanticError( string( "duplicate declaration name " ) + *param->name );
+				if ( ! decl->type ) throw SemanticError( string( "duplicate parameter name " ) + *param->name );
+				param->type = decl->type;
+				decl->type = nullptr;
+				param->attributes.splice( param->attributes.end(), decl->attributes );
+			} // if
+		} // for
+		if ( decl->type ) throw SemanticError( string( "missing name in parameter list " ) + *decl->name );
+	} // for
+	for ( DeclarationNode * param = function.idList; param != nullptr; param = dynamic_cast< DeclarationNode* >( param->get_next() ) ) {
+		if ( ! param->type ) {
+			param->type = new TypeData( TypeData::Basic );
+			param->type->basictype = DeclarationNode::Int;
+		} // if
+	} // for
+
+	function.params = function.idList;
+	function.idList = nullptr;
+	delete function.oldDeclList;
+	function.oldDeclList = nullptr;
+} // buildKRFunction
+
 // Local Variables: //
 // tab-width: 4 //
Index: src/Parser/TypeData.h
===================================================================
--- src/Parser/TypeData.h	(revision 138e29ecafd7b7c16c01bc5bf07aa51231168aa0)
+++ src/Parser/TypeData.h	(revision 94ad12f5f91121af7a3b0495b4b3abae9618fdfe)
@@ -10,6 +10,6 @@
 // Created On       : Sat May 16 15:18:36 2015
 // Last Modified By : Peter A. Buhr
-// Last Modified On : Thu Feb  2 17:02:09 2017
-// Update Count     : 146
+// Last Modified On : Thu Feb 16 14:30:05 2017
+// Update Count     : 153
 //
 
@@ -52,7 +52,7 @@
 
 	struct Function_t {
-		DeclarationNode * params;
-		DeclarationNode * idList;						// old-style
-		DeclarationNode * oldDeclList;
+		mutable DeclarationNode * params;				// mutables modified in buildKRFunction
+		mutable DeclarationNode * idList;				// old-style
+		mutable DeclarationNode * oldDeclList;
 		StatementNode * body;
 		bool hasBody;
@@ -113,4 +113,5 @@
 Declaration * buildDecl( const TypeData *, const std::string &, DeclarationNode::StorageClass, Expression *, bool isInline, bool isNoreturn, LinkageSpec::Spec, ConstantExpr *asmName, Initializer * init = nullptr, std::list< class Attribute * > attributes = std::list< class Attribute * >() );
 FunctionType * buildFunction( const TypeData * );
+void buildKRFunction( const TypeData::Function_t & function );
 
 #endif // TYPEDATA_H
