Fix warnings of c++ compilation#476
Closed
jaeyoo wants to merge 11 commits into
Closed
Conversation
Member
Author
|
Please merge this one earlier than #477 if possible |
Contributor
|
Seems stale at this point, do you wish to update or should we close for now? |
Member
Author
Let me update it :) |
zaqqwerty
suggested changes
Aug 26, 2021
zaqqwerty
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the updates, have a couple questions. If the resolution of the static function stuff is unclear we can merge the rest without touching util_qsim, this will just leave unused function warnings, which is a big improvement :)
jaeyoo
pushed a commit
to jaeyoo/quantum
that referenced
this pull request
Mar 30, 2023
Change environment variable name.
Member
mhucka
added a commit
to mhucka/quantum
that referenced
this pull request
Jun 5, 2026
PR tensorflow#476 (dating from 2021) aimed to resolve numerous warnings emitted by the C++ compiler. Most have already been resolved since the time the PR was written, but some still remained. This PR addresses most (possibly all) the rest that can be addressed. (Some cannot be addressed directly because they come from other libraries.) All of these concern the core ops (`tensorflow_quantum/core/ops/`) and all the warnings are essentially in the same category of thing, so while this PR touches many files, it seems appropriate to handle them together: * Changed the data type of variables `max_num_qubits` and `min_num_qubits` from `int` to `uint64_t` to match the underlying data structures and vector iterations where they were being used. * Changed the data types of some iterator and limit variables (`int q_ind`, `int64_t q_ind`, `int nq`, and `int largest_nq`) to `uint64_t` to resolve compiler warnings when evaluated against the updated `max_num_qubits` mentioned above. * Changed the data type of `output_dim_size` from `int` to `size_t` where this variable was directly assigned the result of `maps.size()` and similar standard library size methods. * Retained the data types of variables like `max_psum_length` have been left as `int` because they interface with Protobuf sizes, which are signed ints. * In `configure.sh`, removed `-Wno-unused-but-set-variable` from the flags used during builds of `tensorflow_quantum/core/ops/noise/tfq_.*`, since the underlying reason for the warnings has been addressed by this PR. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#475