-
Notifications
You must be signed in to change notification settings - Fork 415
[Warnings] Cleaned Up Most Warnings in GCC-13 #2700
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
vaughnbetz
merged 9 commits into
verilog-to-routing:master
from
AlexandreSinger:feature-noble-warnings
Aug 21, 2024
Merged
[Warnings] Cleaned Up Most Warnings in GCC-13 #2700
vaughnbetz
merged 9 commits into
verilog-to-routing:master
from
AlexandreSinger:feature-noble-warnings
Aug 21, 2024
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In RoutePathManager, the forward declaration of the RoutingContext was incorrectly made a class instead of a struct. This was causing several warnings in the Clang build (but not in the GCC build). Fixed since the forward declaration should match the declaration.
This code previously used an int to calculate the size of an allocation, which was done by shifting a bit; however, this is technically ill-formed since this could generate a negative value. This was causing a warning to appear in the most recent version of GCC. Although this is technically ok, its best that this properly uses size_t instead.
The way this section of code was written could potentially lead to an array access out of bounds. This was causing a warning in future versions of GCC. Simply fixed this issue.
This line of code was likely a mistake; the src of a strcpy should never be a freshly allocated pointer. Fixed the line to likely what the coder intended.
GCC sometimes gets confused with how strings are allocated, when they are C strings allocated by hand. Changed to an std string since it is easier to work with and removes the warning.
When a class returns a reference to a dereferenced pointer, if the pointer does not point to a const object, returning that pointer as a const has no effect. This was causing warnings. To fix this, we want a refernece to a const object not a const reference to an object (silly, I know). So we need to make this more clear in the class.
The -lz flag is used to link with the ZLIB library, but the library was already being linked; so there was no reason to add the flag. This was causing an insane number of warnings in the Clang build. If this is added back for any reason, this should be checked. Also cleaned up how ZLIB was being linked. ZLIB is required for reading and processing the atom circuit; so it should always be linked with VPR.
14ef97b
to
29cfb1c
Compare
@vaughnbetz This has passed CI. Please review when you have a moment. This PR is cleaning up simple warnings in GCC-13 in preparation for us upgrading the CI. Still more warnings and things to fix, but this fixes most of them. |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
build
Build system
external_libs
lang-cpp
C/C++ code
lang-make
CMake/Make code
VPR
VPR FPGA Placement & Routing Tool
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR resolves several small issues which were causing warnings in the GCC13 build. Trying to get GCC13 warning clean before we upgrade the CI.
This resolves the following warnings:
See each of the associated commits for more details.
There are still warnings coming from the nDMatrix class (discussed previously) which should be resolved in its own PR. There are also a couple of other small warnings which are slightly more complex to resolve.