Skip to content

Initialized enums that might not be assigned depending on NO_GRAPHICS macro #2187

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

hzeller
Copy link
Contributor

@hzeller hzeller commented Nov 3, 2022

small cleanup.

@github-actions github-actions bot added the VPR VPR FPGA Placement & Routing Tool label Nov 3, 2022
@hzeller hzeller force-pushed the 20221103-initialize-enums branch from 81637b6 to 77352cf Compare November 4, 2022 00:51
@hzeller hzeller requested a review from MohamedElgammal April 26, 2023 17:39
@@ -1462,7 +1462,7 @@ static e_move_result try_swap(const t_annealing_state* state,
rlim = state->rlim;
}

e_create_move create_move_outcome;
e_create_move create_move_outcome = e_create_move::ABORT;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move the #ifndef NO_GRAPHICS here and the #endif after "} else" and before the "if" in line 1472 so that the manual_move_enabled will only be checked if the graphics are enabled (NO_GRAPHICS isn't defined). Then, create_move_outcome will be initialized in all the cases.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hzeller : any thoughts on Mohamed's comment? I'm OK with merging as is, but if you and @MohamedElgammal have a better fix please make the change now so we fix this one way or the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the suggestion, but I am busy with other things currently, so if we merge it now, I leave it to @MohamedElgammal to do another PR to improve the situation.

Copy link
Contributor

@MohamedElgammal MohamedElgammal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to initialize these values. However, I think it may be even cleaner to move the #ifndef NO_GRAPHICS macro in line 1469 to only check the manual_move_enabled flag when graphics are enabled.

@vaughnbetz
Copy link
Contributor

OK, made an issue to track that.

@vaughnbetz vaughnbetz merged commit b86ab99 into verilog-to-routing:master Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VPR VPR FPGA Placement & Routing Tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants