3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-03 09:50:24 +00:00

Make log_file_warning() use variadic templates.

This commit is contained in:
Robert O'Callahan 2025-07-22 04:03:43 +00:00
parent 9023b97e41
commit f4b91ecaf0
2 changed files with 11 additions and 10 deletions

View file

@ -309,15 +309,10 @@ void log_formatted_warning(std::string_view prefix, std::string message)
}
}
void log_file_warning(const std::string &filename, int lineno,
const char *format, ...)
void log_formatted_file_warning(std::string_view filename, int lineno, std::string str)
{
va_list ap;
va_start(ap, format);
std::string prefix = stringf("%s:%d: Warning: ",
filename.c_str(), lineno);
log_formatted_warning(prefix, vstringf(format, ap));
va_end(ap);
std::string prefix = stringf("%s:%d: Warning: ", filename, lineno);
log_formatted_warning(prefix, std::move(str));
}
void log_file_info(const std::string &filename, int lineno,