Skip to content
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

fix: avoid warnings on Windows #12701

Closed
wants to merge 1 commit into from
Closed

fix: avoid warnings on Windows #12701

wants to merge 1 commit into from

Conversation

coryan
Copy link
Contributor

@coryan coryan commented May 6, 2023

On Wndows, size_t is 64-bits, and int is 32-bits. That makes conversions from size_t to int potentially lossy, and they generate warnings. In this case an int variable was assigned to size_t and then passed to functions consuming int. Seems simpler to use auto and avoid these problems altogether.

On Wndows, `size_t` is 64-bits, and `int` is 32-bits. That makes
conversions from `size_t` to `int` potentially lossy, and they generate
warnings.  In this case an `int` variable was assigned to `size_t` and
then passed to functions consuming `int`. Seems simpler to use `auto`
and avoid these problems altogether.
@coryan coryan requested a review from a team as a code owner May 6, 2023 22:00
@coryan coryan requested review from ericsalo and removed request for a team May 6, 2023 22:00
@fowles fowles added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label May 7, 2023
@github-actions github-actions bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label May 7, 2023
@copybara-service copybara-service bot closed this in f9108c2 May 7, 2023
@coryan coryan deleted the fix-warnings-repeated-field-warnings-in-msvc branch May 8, 2023 15:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants