Skip to content

Add in-class initializers for t_placer_costs to fix coverity scan defect #1557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Bill-hbrhbr
Copy link
Contributor

Description

Fix Coverity Scan for t_placer_costs in place_util.h.

Original report:
Please find the latest report on new defect(s) introduced to Verilog to Routing found with Coverity Scan.

1 new defect(s) introduced to Verilog to Routing found with Coverity Scan.
1 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.

New defect(s) Reported-by: Coverity Scan
Showing 1 of 1 defect(s)

** CID 214341: Uninitialized members (UNINIT_CTOR)
/home/travis/build/verilog-to-routing/vtr-verilog-to-routing/vpr/src/place/place_util.h: 51 in t_placer_costs::t_placer_costs(t_place_algorithm)()


*** CID 214341: Uninitialized members (UNINIT_CTOR)
/home/travis/build/verilog-to-routing/vtr-verilog-to-routing/vpr/src/place/place_util.h: 51 in t_placer_costs::t_placer_costs(t_place_algorithm)()
45 double timing_cost;
46 double bb_cost_norm;
47 double timing_cost_norm;
48
49 public: //Constructor
50 t_placer_costs(t_place_algorithm algo)

CID 214341:  Uninitialized members  (UNINIT_CTOR)
Non-static class member "timing_cost_norm" is not initialized in this constructor nor in any functions that it calls.

51 : place_algorithm(algo) {}
52
53 public: //Mutator
54 void update_norm_factors();
55
56 private:

Types of changes

  • Bug fix (change which fixes an issue)
  • New feature (change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

@Bill-hbrhbr Bill-hbrhbr self-assigned this Sep 22, 2020
@probot-autolabeler probot-autolabeler bot added lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool labels Sep 22, 2020
@vaughnbetz
Copy link
Contributor

Looks good Bill, thanks. Will merge when CI goes green.

@Bill-hbrhbr Bill-hbrhbr merged commit 0eeafcc into verilog-to-routing:master Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lang-cpp C/C++ code VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants