From b22a48f5e5a9d71bbc738ba95b3273e442757eb0 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Mon, 4 Jan 2021 18:14:04 -0800 Subject: [PATCH] gcc compiler warnings --- dcalc/ArnoldiReduce.cc | 2 +- dcalc/DmpCeff.cc | 4 +- include/sta/Report.hh | 3 +- liberty/TableModel.cc | 12 +++--- sdf/ReportAnnotation.cc | 2 +- search/ClkSkew.cc | 2 +- search/ReportPath.cc | 88 ++++++++++++++++++++--------------------- search/TagGroup.cc | 7 ++-- util/Report.cc | 8 +++- 9 files changed, 68 insertions(+), 60 deletions(-) diff --git a/dcalc/ArnoldiReduce.cc b/dcalc/ArnoldiReduce.cc index 97eaae93..e1e87955 100644 --- a/dcalc/ArnoldiReduce.cc +++ b/dcalc/ArnoldiReduce.cc @@ -605,7 +605,7 @@ ArnoldiReduce::makeRcmodelFromTs() string line = stdstrPrint("U[%d]",h); for (i=0;ireportLine(line); + report_->reportLineString(line); } } } diff --git a/dcalc/DmpCeff.cc b/dcalc/DmpCeff.cc index 75326815..ac6b6cc1 100644 --- a/dcalc/DmpCeff.cc +++ b/dcalc/DmpCeff.cc @@ -478,13 +478,13 @@ DmpAlg::showJacobian() string line = " "; for (int j = 0; j < nr_order_; j++) line += stdstrPrint("%12s", dmp_param_index_strings[j]); - report_->reportLine(line); + report_->reportLineString(line); line.clear(); for (int i = 0; i < nr_order_; i++) { line += stdstrPrint("%4s ", dmp_func_index_strings[i]); for (int j = 0; j < nr_order_; j++) line += stdstrPrint("%12.3e ", fjac_[i][j]); - report_->reportLine(line); + report_->reportLineString(line); } } diff --git a/include/sta/Report.hh b/include/sta/Report.hh index 10d546ce..96d8e9d1 100644 --- a/include/sta/Report.hh +++ b/include/sta/Report.hh @@ -42,7 +42,8 @@ public: virtual void reportLine(const char *fmt, ...) __attribute__((format (printf, 2, 3))); virtual void reportLineString(const char *line); - virtual void reportLine(const string &line); + virtual void reportLineString(const string &line); + virtual void reportBlankLine(); //////////////////////////////////////////////////////////////// diff --git a/liberty/TableModel.cc b/liberty/TableModel.cc index c3deb1e5..c54737f5 100644 --- a/liberty/TableModel.cc +++ b/liberty/TableModel.cc @@ -845,14 +845,14 @@ Table1::report(const Units *units, line += unit1->asString(axis1_->axisValue(index1), digits); line += " "; } - report->reportLine(line); + report->reportLineString(line); line.clear(); for (size_t index1 = 0; index1 < axis1_->size(); index1++) { line += table_unit->asString(tableValue(index1), digits); line += " "; } - report->reportLine(line); + report->reportLineString(line); } //////////////////////////////////////////////////////////////// @@ -1036,7 +1036,7 @@ Table2::report(const Units *units, line += unit2->asString(axis2_->axisValue(index2), digits); line += " "; } - report->reportLine(line); + report->reportLineString(line); for (size_t index1 = 0; index1 < axis1_->size(); index1++) { line = unit1->asString(axis1_->axisValue(index1), digits); @@ -1045,7 +1045,7 @@ Table2::report(const Units *units, line += table_unit->asString(tableValue(index1, index2), digits); line += " "; } - report->reportLine(line); + report->reportLineString(line); } } @@ -1300,7 +1300,7 @@ Table3::report(const Units *units, line += unit3->asString(axis3_->axisValue(index3), digits); line += " "; } - report->reportLine(line); + report->reportLineString(line); for (size_t index2 = 0; index2 < axis2_->size(); index2++) { line = unit2->asString(axis2_->axisValue(index2),digits); @@ -1309,7 +1309,7 @@ Table3::report(const Units *units, line += table_unit->asString(tableValue(index1, index2, index3), digits); line += " "; } - report->reportLine(line); + report->reportLineString(line); } } } diff --git a/sdf/ReportAnnotation.cc b/sdf/ReportAnnotation.cc index 4ce6718d..eb012496 100644 --- a/sdf/ReportAnnotation.cc +++ b/sdf/ReportAnnotation.cc @@ -466,7 +466,7 @@ ReportAnnotated::reportArcs(const char *header, bool report_annotated, PinSet &pins) { - report_->reportLine(""); + report_->reportBlankLine(); report_->reportLineString(header); PinSeq sorted_pins; sortPinSet(&pins, network_, sorted_pins); diff --git a/search/ClkSkew.cc b/search/ClkSkew.cc index 6ab64e13..4e5bcaf7 100644 --- a/search/ClkSkew.cc +++ b/search/ClkSkew.cc @@ -162,7 +162,7 @@ ClkSkews::reportClkSkew(ClockSet *clks, } else report_->reportLine("No launch/capture paths found."); - report_->reportLine(""); + report_->reportBlankLine(); } skews.deleteContents(); diff --git a/search/ReportPath.cc b/search/ReportPath.cc index 5dadffbd..68ca4c95 100644 --- a/search/ReportPath.cc +++ b/search/ReportPath.cc @@ -946,7 +946,7 @@ ReportPath::reportEndHeader() reportField("Required", field_total_, line); line += ' '; reportField("Actual", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); // Line two. line.clear(); @@ -957,7 +957,7 @@ ReportPath::reportEndHeader() reportField("Delay", field_total_, line); line += ' '; reportField("Slack", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() + field_total_->width() * 3 + 3); } @@ -972,7 +972,7 @@ ReportPath::reportEndLine(PathEnd *end) reportSpaceFieldDelay(end->requiredTimeOffset(this), early_late, line); reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, line); reportSpaceSlack(end, line); - report_->reportLine(line); + report_->reportLineString(line); } //////////////////////////////////////////////////////////////// @@ -986,7 +986,7 @@ ReportPath::reportSummaryHeader() reportDescription("Endpoint", line); line += ' '; reportField("Slack", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() * 2 + field_total_->width() + 1); } @@ -1006,7 +1006,7 @@ ReportPath::reportSummaryLine(PathEnd *end) reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, line); else reportSpaceFieldDelay(end->slack(this), early_late, line); - report_->reportLine(line); + report_->reportLineString(line); } string @@ -1052,7 +1052,7 @@ ReportPath::reportSlackOnlyHeader() reportDescription("Group", line); line += ' '; reportField("Slack", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() + field_total_->width() + 1); } @@ -1067,7 +1067,7 @@ ReportPath::reportSlackOnly(PathEnd *end) reportSpaceFieldDelay(end->dataArrivalTimeOffset(this), early_late, line); else reportSpaceFieldDelay(end->slack(this), early_late, line); - report_->reportLine(line); + report_->reportLineString(line); } //////////////////////////////////////////////////////////////// @@ -1121,7 +1121,7 @@ ReportPath::reportMpwHeaderShort() reportField("Required", field_total_, line); line += ' '; reportField("Actual", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); line.clear(); reportDescription("Pin", line); @@ -1131,7 +1131,7 @@ ReportPath::reportMpwHeaderShort() reportField("Width", field_total_, line); line += ' '; reportField("Slack", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() + field_total_->width() * 3 + 3); } @@ -1147,7 +1147,7 @@ ReportPath::reportShort(MinPulseWidthCheck *check) reportSpaceFieldTime(check->minWidth(this), line); reportSpaceFieldDelay(check->width(this), EarlyLate::late(), line); reportSpaceSlack(check->slack(this), line); - report_->reportLine(line); + report_->reportLineString(line); } void @@ -1157,7 +1157,7 @@ ReportPath::reportVerbose(MinPulseWidthCheck *check) const char *pin_name = cmd_network_->pathName(check->pin(this)); line += "Pin: "; line += pin_name; - report_->reportLine(line); + report_->reportLineString(line); report_->reportLine("Check: sequential_clock_pulse_width"); reportBlankLine(); @@ -1272,7 +1272,7 @@ ReportPath::reportPeriodHeaderShort() reportField("Min", field_total_, line); line += ' '; reportField("", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); line.clear(); reportDescription("Pin", line); @@ -1282,7 +1282,7 @@ ReportPath::reportPeriodHeaderShort() reportField("Period", field_total_, line); line += ' '; reportField("Slack", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() + field_total_->width() * 3 + 3); } @@ -1296,7 +1296,7 @@ ReportPath::reportShort(MinPeriodCheck *check) reportSpaceFieldDelay(check->period(), EarlyLate::early(), line); reportSpaceFieldDelay(check->minPeriod(this), EarlyLate::early(), line); reportSpaceSlack(check->slack(this), line); - report_->reportLine(line); + report_->reportLineString(line); } void @@ -1306,7 +1306,7 @@ ReportPath::reportVerbose(MinPeriodCheck *check) const char *pin_name = cmd_network_->pathName(check->pin()); line += "Pin: "; line += pin_name; - report_->reportLine(line); + report_->reportLineString(line); reportLine("period", check->period(), EarlyLate::early()); reportLine("min period", -check->minPeriod(this), EarlyLate::early()); @@ -1367,7 +1367,7 @@ ReportPath::reportMaxSkewHeaderShort() reportField("Actual", field_total_, line); line += ' '; reportField("", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); line.clear(); reportDescription("Pin", line); @@ -1377,7 +1377,7 @@ ReportPath::reportMaxSkewHeaderShort() reportField("Skew", field_total_, line); line += ' '; reportField("Slack", field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() + field_total_->width() * 3 + 3); } @@ -1398,7 +1398,7 @@ ReportPath::reportShort(MaxSkewCheck *check) reportSpaceFieldDelay(check->maxSkew(this), early_late, line); reportSpaceFieldDelay(check->skew(this), early_late, line); reportSpaceSlack(check->slack(this), line); - report_->reportLine(line); + report_->reportLineString(line); } void @@ -1408,15 +1408,15 @@ ReportPath::reportVerbose(MaxSkewCheck *check) const char *clk_pin_name = cmd_network_->pathName(check->clkPin(this)); line += "Constrained Pin: "; line += clk_pin_name; - report_->reportLine(line); + report_->reportLineString(line); const char *ref_pin_name = cmd_network_->pathName(check->refPin(this)); line = "Reference Pin: "; line += ref_pin_name; - report_->reportLine(line); + report_->reportLineString(line); line = "Check: max_skew"; - report_->reportLine(line); + report_->reportLineString(line); reportBlankLine(); reportPathHeader(); @@ -1486,7 +1486,7 @@ ReportPath::reportLimitShortHeader(const ReportField *field) reportField(field->title(), field, line); line += ' '; reportField("Slack", field, line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(field_description_->width() + field->width() * 3 + 3); } @@ -1510,7 +1510,7 @@ ReportPath::reportLimitShort(const ReportField *field, line += (slack >= 0.0) ? " (MET)" : " (VIOLATED)"; - report_->reportLine(line); + report_->reportLineString(line); } void @@ -1530,19 +1530,19 @@ ReportPath::reportLimitVerbose(const ReportField *field, line += rf->shortName(); else line += ' '; - report_->reportLine(line); + report_->reportLineString(line); line = min_max->asString(); line += ' '; line += field->name(); line += ' '; reportField(limit, field, line); - report_->reportLine(line); + report_->reportLineString(line); line = field->name(); line += " "; reportField(value, field, line); - report_->reportLine(line); + report_->reportLineString(line); int name_width = strlen(field->name()) + 5; reportDashLine(name_width + field->width()); @@ -1554,7 +1554,7 @@ ReportPath::reportLimitVerbose(const ReportField *field, line += (slack >= 0.0) ? " (MET)" : " (VIOLATED)"; - report_->reportLine(line); + report_->reportLineString(line); } //////////////////////////////////////////////////////////////// @@ -1711,7 +1711,7 @@ ReportPath::reportStartEndPoint(const char *pt, line = key; line += ": "; line += pt; - report_->reportLine(line); + report_->reportLineString(line); line.clear(); for (unsigned i = 0; i < strlen(key); i++) @@ -1720,7 +1720,7 @@ ReportPath::reportStartEndPoint(const char *pt, line += " ("; line += reason; line += ")"; - report_->reportLine(line); + report_->reportLineString(line); } else { line = key; @@ -1729,7 +1729,7 @@ ReportPath::reportStartEndPoint(const char *pt, line += " ("; line += reason; line += ")"; - report_->reportLine(line); + report_->reportLineString(line); } } @@ -1739,16 +1739,16 @@ ReportPath::reportGroup(const PathEnd *end) string line; line = "Path Group: "; line += search_->pathGroup(end)->name(); - report_->reportLine(line); + report_->reportLineString(line); line = "Path Type: "; line += end->minMax(this)->asString(); - report_->reportLine(line); + report_->reportLineString(line); if (corners_->multiCorner()) { line = "Corner: "; line += end->pathAnalysisPt(this)->corner()->name(); - report_->reportLine(line); + report_->reportLineString(line); } } @@ -2402,7 +2402,7 @@ ReportPath::reportPathJson(const Path *path) line = " \"pin\": \""; line += network_->pathName(pin); line += "\","; - report_->reportLine(line); + report_->reportLineString(line); double x, y; bool exists; @@ -2415,24 +2415,24 @@ ReportPath::reportPathJson(const Path *path) line += " \"y\": "; stringPrint(tmp, "%.9f", y); line += tmp + ","; - report_->reportLine(line); + report_->reportLineString(line); } line = " \"arrival\": "; stringPrint(tmp, "%.3e", delayAsFloat(path->arrival(this))); line += tmp; line += ","; - report_->reportLine(line); + report_->reportLineString(line); line = " \"slew\": "; stringPrint(tmp, "%.3e", delayAsFloat(path->slew(this))); line += tmp; - report_->reportLine(line); + report_->reportLineString(line); line = " }"; if (i < expanded.size() - 1) line += ","; - report_->reportLine(line); + report_->reportLineString(line); } report_->reportLine(" ]"); report_->reportLine("}"); @@ -2868,7 +2868,7 @@ ReportPath::reportPathHeader() } } trimRight(line); - report_->reportLine(line); + report_->reportLineString(line); reportDashLine(); } @@ -2998,7 +2998,7 @@ ReportPath::reportLine(const char *what, } field_index++; } - report_->reportLine(line); + report_->reportLineString(line); } //////////////////////////////////////////////////////////////// @@ -3034,7 +3034,7 @@ ReportPath::reportLineTotal1(const char *what, reportFieldDelayMinus(incr, early_late, field_total_, line); else reportFieldDelay(incr, early_late, field_total_, line); - report_->reportLine(line); + report_->reportLineString(line); } void @@ -3208,7 +3208,7 @@ ReportPath::reportDashLine() } } line += "------"; - report_->reportLine(line); + report_->reportLineString(line); } void @@ -3217,13 +3217,13 @@ ReportPath::reportDashLine(int line_width) string line; for (int i = 0; i < line_width; i++) line += '-'; - report_->reportLine(line); + report_->reportLineString(line); } void ReportPath::reportBlankLine() { - report_->reportLine(""); + report_->reportBlankLine(); } bool diff --git a/search/TagGroup.cc b/search/TagGroup.cc index 2028479d..4e119345 100644 --- a/search/TagGroup.cc +++ b/search/TagGroup.cc @@ -130,7 +130,7 @@ arrivalMapReport(const ArrivalMap *arrival_map, arrival_index, tag->asString(sta)); } - report->reportLine(""); + report->reportBlankLine(); } //////////////////////////////////////////////////////////////// @@ -326,9 +326,10 @@ TagGroupBldr::copyArrivals(TagGroup *tag_group, arrival_iter1.next(tag1, arrival_index1); bool exists2; tag_group->arrivalIndex(tag1, arrival_index2, exists2); - if (!exists2) + if (exists2) + arrivals[arrival_index2] = arrivals_[arrival_index1]; + else sta_->report()->critical(265, "tag group missing tag"); - arrivals[arrival_index2] = arrivals_[arrival_index1]; if (prev_paths) { PathVertexRep *prev_path = &prev_paths_[arrival_index1]; prev_paths[arrival_index2].init(prev_path); diff --git a/util/Report.cc b/util/Report.cc index f8203e4c..ca98483a 100644 --- a/util/Report.cc +++ b/util/Report.cc @@ -89,6 +89,12 @@ Report::reportLine(const char *fmt, ...) va_end(args); } +void +Report::reportBlankLine() +{ + printLine("", 0); +} + void Report::reportLineString(const char *line) { @@ -96,7 +102,7 @@ Report::reportLineString(const char *line) } void -Report::reportLine(const string &line) +Report::reportLineString(const string &line) { printLine(line.c_str(), line.length()); }