diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index 3ab03e988e6..195a4f71ec6 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -218,8 +218,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty, } if (MTy->isVarArg()) { if (!MTy->getParamTypes().empty()) - FunctionInards << ", "; - FunctionInards << "..."; + FunctionInards << ", ..."; + } else if (MTy->getParamTypes().empty()) { + FunctionInards << "void"; } FunctionInards << ")"; std::string tstr = FunctionInards.str(); diff --git a/lib/Target/CBackend/Writer.cpp b/lib/Target/CBackend/Writer.cpp index 3ab03e988e6..195a4f71ec6 100644 --- a/lib/Target/CBackend/Writer.cpp +++ b/lib/Target/CBackend/Writer.cpp @@ -218,8 +218,9 @@ std::ostream &CWriter::printType(std::ostream &Out, const Type *Ty, } if (MTy->isVarArg()) { if (!MTy->getParamTypes().empty()) - FunctionInards << ", "; - FunctionInards << "..."; + FunctionInards << ", ..."; + } else if (MTy->getParamTypes().empty()) { + FunctionInards << "void"; } FunctionInards << ")"; std::string tstr = FunctionInards.str();