Skip to content

Fix warnings of c++ compilation#476

Closed
jaeyoo wants to merge 11 commits into
masterfrom
fix_warnings
Closed

Fix warnings of c++ compilation#476
jaeyoo wants to merge 11 commits into
masterfrom
fix_warnings

Conversation

@jaeyoo

@jaeyoo jaeyoo commented Feb 7, 2021

Copy link
Copy Markdown
Member

@jaeyoo

jaeyoo commented Feb 8, 2021

Copy link
Copy Markdown
Member Author

Please merge this one earlier than #477 if possible

@zaqqwerty

zaqqwerty commented Aug 25, 2021

Copy link
Copy Markdown
Contributor

Seems stale at this point, do you wish to update or should we close for now?

@jaeyoo

jaeyoo commented Aug 25, 2021

Copy link
Copy Markdown
Member Author

Seems stale at this point, do you wish to update or should we close for now?

Let me update it :)

@jaeyoo jaeyoo requested a review from zaqqwerty August 26, 2021 00:34

@zaqqwerty zaqqwerty left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 :)

Comment thread tensorflow_quantum/core/ops/math_ops/tfq_inner_product.cc Outdated
Comment thread tensorflow_quantum/core/ops/math_ops/tfq_inner_product.cc Outdated
Comment thread tensorflow_quantum/core/ops/math_ops/tfq_inner_product.cc Outdated
Comment thread tensorflow_quantum/core/ops/math_ops/tfq_inner_product.cc Outdated
Comment thread tensorflow_quantum/core/ops/math_ops/tfq_inner_product.cc Outdated
Comment thread tensorflow_quantum/core/ops/math_ops/tfq_inner_product.cc Outdated
Comment thread scripts/test_all.sh Outdated
jaeyoo pushed a commit to jaeyoo/quantum that referenced this pull request Mar 30, 2023
@mhucka mhucka added the area/health Involves general matters of project configuration, health, maintenance, and similar concerns label Dec 2, 2024
@mhucka mhucka self-assigned this Feb 4, 2026
@mhucka

mhucka commented May 13, 2026

Copy link
Copy Markdown
Member

Many of these have been fixed since the time this PR was written. Some remaining warnings are addressed by #1070.

I believe now what remains unresolved is warnings due to code in external libraries. So, I think it's reasonable to close this PR when #1070 is merged.

@mhucka mhucka closed this May 22, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/health Involves general matters of project configuration, health, maintenance, and similar concerns

Development

Successfully merging this pull request may close these issues.

3 participants