From 35e3e40212bdc58c47fbd93cba24e155e19f39d9 Mon Sep 17 00:00:00 2001 From: AlexandreSinger Date: Sat, 30 Nov 2024 11:23:00 -0500 Subject: [PATCH] [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 and rr_graph files. 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: https://github.com/SymbiFlow/uxsdcxx/pull/53 --- libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h | 2 +- vpr/src/base/gen/vpr_constraints_uxsdcxx.h | 2 +- vpr/src/draw/draw_rr.cpp | 3 +-- vpr/src/draw/search_bar.cpp | 6 ++++-- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h b/libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h index c9a21c636fd..9687e819805 100644 --- a/libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h +++ b/libs/librrgraph/src/io/gen/rr_graph_uxsdcxx.h @@ -4360,7 +4360,7 @@ inline void attr_error(std::bitset astate, const char * const *lookup, const } inline void get_line_number(const char *filename, std::ptrdiff_t target_offset, int * line, int * col) { - std::unique_ptr f(fopen(filename, "rb"), fclose); + std::unique_ptr f(fopen(filename, "rb"), fclose); if (!f) { throw std::runtime_error(std::string("Failed to open file") + filename); diff --git a/vpr/src/base/gen/vpr_constraints_uxsdcxx.h b/vpr/src/base/gen/vpr_constraints_uxsdcxx.h index 7361fc63141..d12118cb066 100644 --- a/vpr/src/base/gen/vpr_constraints_uxsdcxx.h +++ b/vpr/src/base/gen/vpr_constraints_uxsdcxx.h @@ -1207,7 +1207,7 @@ inline void attr_error(std::bitset astate, const char* const* lookup, const s } inline void get_line_number(const char* filename, std::ptrdiff_t target_offset, int* line, int* col) { - std::unique_ptr f(fopen(filename, "rb"), fclose); + std::unique_ptr f(fopen(filename, "rb"), fclose); if (!f) { throw std::runtime_error(std::string("Failed to open file") + filename); diff --git a/vpr/src/draw/draw_rr.cpp b/vpr/src/draw/draw_rr.cpp index e3c2467cd9e..62534bb0cc3 100644 --- a/vpr/src/draw/draw_rr.cpp +++ b/vpr/src/draw/draw_rr.cpp @@ -902,8 +902,7 @@ void draw_get_rr_pin_coords(const t_rr_node& node, float* xcen, float* ycen, con default: vpr_throw(VPR_ERROR_OTHER, __FILE__, __LINE__, - "in draw_get_rr_pin_coords: Unexpected side %s.\n", - TOTAL_2D_SIDE_STRINGS[pin_side]); + "in draw_get_rr_pin_coords: Unexpected side.\n"); break; } diff --git a/vpr/src/draw/search_bar.cpp b/vpr/src/draw/search_bar.cpp index 5e78934841a..ada698cf136 100644 --- a/vpr/src/draw/search_bar.cpp +++ b/vpr/src/draw/search_bar.cpp @@ -157,7 +157,9 @@ void search_and_highlight(GtkWidget* /*widget*/, ezgl::application* app) { warning_dialog_box("Invalid Net Name"); return; //name not exist } - for(auto clb_net_id: atom_ctx.lookup.clb_nets(atom_net_id).value()){ + + const auto clb_nets = atom_ctx.lookup.clb_nets(atom_net_id); + for(auto clb_net_id: clb_nets.value()){ highlight_nets(clb_net_id); } } @@ -541,4 +543,4 @@ std::string get_search_type(ezgl::application* app) { return searchType; } -#endif /* NO_GRAPHICS */ \ No newline at end of file +#endif /* NO_GRAPHICS */