-
Notifications
You must be signed in to change notification settings - Fork 414
[SPECRand] Uninitialized Induction Variable in spec_rand.cpp #2831
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
Comments
@heshpdx Are we able to modify this file on the VTR side with this fix? Or does the change need to be done elsewhere first? |
Feel free to edit. This is already fixed in my tree. Sorry for not sharing! |
I dug up these edits I made to fix other warnings. Sharing in case it helps you.
|
Thank you so much Mahesh! I have updated |
In the GCC13 build of VTR, we are getting the following warning from

spec_rand.cpp
:This code can be found in VTR here:
vtr-verilog-to-routing/libs/libvtrutil/src/specrand.cpp
Lines 122 to 125 in ec23fea
Leaving the induction variable uninitialized is undefined behavior, I believe; however, the compiler is likely initializing it to zero for us. The fix for this is to simply update it to
size_t kk = 0
in the preamble of the for loop; however, since this file is from outside of the VTR repo I am not sure if we can change this file.The text was updated successfully, but these errors were encountered: