3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-23 09:05:32 +00:00

Added format __attribute__ to stringf()

This commit is contained in:
Clifford Wolf 2014-10-10 17:22:08 +02:00
parent 7cb0d3aa1a
commit bbd808072b
5 changed files with 8 additions and 6 deletions

View file

@ -68,7 +68,7 @@ struct SatGen
else
vec.push_back(bit == (undef_mode ? RTLIL::State::Sx : RTLIL::State::S1) ? ez->CONST_TRUE : ez->CONST_FALSE);
} else {
std::string name = pf + stringf(bit.wire->width == 1 ? "%s" : "%s [%d]", RTLIL::id2cstr(bit.wire->name), bit.offset);
std::string name = pf + (bit.wire->width == 1 ? stringf("%s", log_id(bit.wire)) : stringf("%s [%d]", log_id(bit.wire->name), bit.offset));
vec.push_back(ez->frozen_literal(name));
imported_signals[pf][bit] = vec.back();
}

View file

@ -82,7 +82,7 @@ namespace RTLIL {
struct Cell;
}
std::string stringf(const char *fmt, ...);
std::string stringf(const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
std::string vstringf(const char *fmt, va_list ap);
template<typename T> int GetSize(const T &obj) { return obj.size(); }
int GetSize(RTLIL::Wire *wire);