Skip to content

Commit b004262

Browse files
[Warnings] Resolved Basic Warnings for GCC13
Resolved a warning in search_bar.cpp which warned about a reference to a temporary. Simply fixed by splitting the statement into two lines. Resolved a warning in draw_rr.cpp where a print statement was trying to access an invalid location in an array. The print statement did not make sense, it was trying to print an undefined side. This was removed. Resolved a warning in the automatically generated vpr_constraints file. This was an interesting warning due to the decltype method returning the attributes of the FILE pointer, but this was passed into a template which discards the attributes (this generates a warning). Resolved this manually locally and raised a PR on the uxsdcxx repo with this fix: SymbiFlow/uxsdcxx#53
1 parent a2be7c5 commit b004262

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

vpr/src/base/gen/vpr_constraints_uxsdcxx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,7 +1207,7 @@ inline void attr_error(std::bitset<N> astate, const char* const* lookup, const s
12071207
}
12081208

12091209
inline void get_line_number(const char* filename, std::ptrdiff_t target_offset, int* line, int* col) {
1210-
std::unique_ptr<FILE, decltype(&fclose)> f(fopen(filename, "rb"), fclose);
1210+
std::unique_ptr<FILE,int(*)(FILE*)> f(fopen(filename, "rb"), fclose);
12111211

12121212
if (!f) {
12131213
throw std::runtime_error(std::string("Failed to open file") + filename);

vpr/src/draw/draw_rr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,8 +902,7 @@ void draw_get_rr_pin_coords(const t_rr_node& node, float* xcen, float* ycen, con
902902

903903
default:
904904
vpr_throw(VPR_ERROR_OTHER, __FILE__, __LINE__,
905-
"in draw_get_rr_pin_coords: Unexpected side %s.\n",
906-
TOTAL_2D_SIDE_STRINGS[pin_side]);
905+
"in draw_get_rr_pin_coords: Unexpected side.\n");
907906
break;
908907
}
909908

vpr/src/draw/search_bar.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) {
157157
warning_dialog_box("Invalid Net Name");
158158
return; //name not exist
159159
}
160-
for(auto clb_net_id: atom_ctx.lookup.clb_nets(atom_net_id).value()){
160+
161+
const auto clb_nets = atom_ctx.lookup.clb_nets(atom_net_id);
162+
for(auto clb_net_id: clb_nets.value()){
161163
highlight_nets(clb_net_id);
162164
}
163165
}
@@ -541,4 +543,4 @@ std::string get_search_type(ezgl::application* app) {
541543
return searchType;
542544
}
543545

544-
#endif /* NO_GRAPHICS */
546+
#endif /* NO_GRAPHICS */

0 commit comments

Comments
 (0)