-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Remove implicit narrowing conversions from zlib #91245
Remove implicit narrowing conversions from zlib #91245
Conversation
and clang implicit-int-conversion Descriptions of each changes are in the respective .patch files.
Tagging subscribers to this area: @dotnet/area-system-io-compression Issue DetailsAllows us to reenable mandatory MSVC C4244 compiler warning and clang's "implicit-int-conversion" warning. See the individual .patch files for a description of the changes and justification of their correctness.
|
Testing: On my Windows x64 box, I validated the zlib-intel build under MSVC. Then I changed my local .cmake files to force usage of zlib instead of zlib-intel and validated that it built correctly under MSVC. On my WSL box, I modified my local .cmake files to force it to use these zlib sources instead of the OS's inbox zlib. I also injected an I also do plan on submitting this upstream to both zlib and zlib-intel if it passes review here, since others could also benefit from these changes. This PR shouldn't introduce any behavioral changes, since it should produce the same AST under the covers. It just makes the casts explicit instead of implicit so that we can re-enable required warnings. |
Is it your intention to get this backported to 8.0? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No blocking comments, just two questions for my own education and a small suggestion. Thanks for submitting this change.
@@ -0,0 +1,75 @@ | |||
From edabaf799fd071a328e0adb743a98628df6649f0 Mon Sep 17 00:00:00 2001 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is a patch file needed in a PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes it easier to separate our customizations so when we import a new upstream version we can just re-apply the patch.
@@ -721,7 +721,7 @@ local void scan_tree(s, tree, max_code) | |||
if (++count < max_count && curlen == nextlen) { | |||
continue; | |||
} else if (count < min_count) { | |||
s->bl_tree[curlen].Freq += count; | |||
s->bl_tree[curlen].Freq += (ush)count; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's ush
? Having trouble finding its definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's from a typedef here:
runtime/src/native/external/zlib/zutil.h
Line 41 in f750bb0
typedef unsigned short ush; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Oof, I really dislike cryptic c typedefs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. It's trying to match the maintainer's style as closely as possible, which is why it could look strange from our eyes.
Yes, since TSA will eventually complain if we don't. But honestly it can wait until after RC / RTM if needed. |
|
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6165145907 |
Allows us to reenable mandatory MSVC C4244 compiler warning and clang's "implicit-int-conversion" warning.
See the individual .patch files for a description of the changes and justification of their correctness.