ibex_pcounts: resolve uninitialize warning

Although the current code isn't wrong as far as I can tell, it would be
better to initialize the lognest_name_length variable when it is
declared to avoid a build warning with older Verilator versions.
This commit is contained in:
Marno van der Maas 2024-11-27 16:42:46 +00:00 committed by Marno van der Maas
parent 667fd20d2e
commit 88d27a0944

View file

@ -53,10 +53,9 @@ static bool has_hpm_counter(int index) {
std::string ibex_pcount_string(bool csv) {
char separator = csv ? ',' : ':';
std::string::size_type longest_name_length;
std::string::size_type longest_name_length = 0;
if (!csv) {
longest_name_length = 0;
for (int i = 0; i < ibex_counter_names.size(); ++i) {
if (has_hpm_counter(i)) {
longest_name_length =