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

Build fails due to warnings C4267: '=': conversion from 'size_t' to 'uInt', possible loss of data #2711

Closed
ajishna opened this issue Oct 13, 2023 · 4 comments
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue

Comments

@ajishna
Copy link

ajishna commented Oct 13, 2023

Describe the bug

strm.avail_in aws-sdk-cpp/src/aws-cpp-sdk-core/source/client/RequestCompression.cpp
has improper conversions at 2 locations:
Line 159:
strm.avail_in = (flush == Z_FINISH)?toRead-1:toRead; //skip EOF if included
and Line 280:
strm.avail_in = toRead;

Found when building custom client.
Worked around with adding #pragma warning(suppress: 4267) on the source.

Expected Behavior

Build should not fail

Current Behavior

Build fails when building custom clients with warning treated as error:
C4267: '=': conversion from 'size_t' to 'uInt', possible loss of data

Reproduction Steps

Build custom client with cmake ( flag -DLEGACY_BUILD=ON and -DADD_CUSTOM_CLIENTS=<your_service_name>)

Possible Solution

Fix the conversion issue

Additional Information/Context

No response

AWS CPP SDK version used

1.11.169

Compiler and Version used

Visual Studio 2022

Operating System and version

Windows 10

@ajishna ajishna added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 13, 2023
@jmklix jmklix self-assigned this Oct 16, 2023
@jmklix
Copy link
Member

jmklix commented Oct 16, 2023

Can you try turning off warning as errors? You can do this with this cmake flag:

-DAWS_SDK_WARNINGS_ARE_ERRORS=OFF

@jmklix jmklix added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Oct 16, 2023
SergeyRyabinin added a commit that referenced this issue Oct 16, 2023
@ajishna
Copy link
Author

ajishna commented Oct 16, 2023

Yes, turning off warning as errors works, but ideally one shouldn't.

SergeyRyabinin added a commit that referenced this issue Oct 16, 2023
@jmklix jmklix added p3 This is a minor priority issue and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 10 days. p2 This is a standard priority issue labels Oct 17, 2023
SergeyRyabinin added a commit that referenced this issue Oct 18, 2023
@jmklix
Copy link
Member

jmklix commented Nov 15, 2023

Should be fixed with the above PR. Closing this issue. Please let me know if you are still seeing the above warning when building this sdk

@jmklix jmklix closed this as completed Nov 15, 2023
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue
Projects
None yet
Development

No branches or pull requests

2 participants