-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Use size_t for hostfxr info count members #48276
Conversation
Tagging subscribers to this area: @vitek-karas, @agocke Issue DetailsInstaller build with GCC failed: /runtime/src/native/corehost/fxr/hostfxr.cpp:456:35: error: narrowing conversion of 'environment_sdk_infos.std::vector<hostfxr_dotnet_environment_sdk_info>::size()' from 'std::vector<hostfxr_dotnet_environment_sdk_info>::size_type' {aka 'long unsigned int'} to 'int32_t' {aka 'int'} inside { } [-Werror=narrowing]
environment_sdk_infos.size(),
~~~~~~~~~~~~~~~~~~~~~~~~~~^~
/runtime/src/native/corehost/fxr/hostfxr.cpp:458:41: error: narrowing conversion of 'environment_framework_infos.std::vector<hostfxr_dotnet_environment_framework_info>::size()' from 'std::vector<hostfxr_dotnet_environment_framework_info>::size_type' {aka 'long unsigned int'} to 'int32_t' {aka 'int'} inside { } [-Werror=narrowing]
environment_framework_infos.size(),
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~ This PR fixes the build.
|
cc @VSadov |
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.
How come this made it through CI - is the warning disabled, or something like that?
The gcc leg only builds CoreCLR subset using gcc v9. Build breakage was caught yesterday by downstream CI set up in the fork. With the fix, it passed. I think Arch Linux and few distros are also using gcc to build the .NET runtime package. Currently all native components (including mono) build just fine with gcc, so IMO expanding the gcc CI coverage to build all components would be great. |
I think some warnings are disabled, or maybe we never build host.native with GCC. |
There are lots of other warnings as well, but those do not seem to be warn-as-error kind. |
The warnings configs are mostly shared between coreclr and installer, our gcc build validation leg is set up to only build coreclr subset. |
the most significant one is:
having 1000+ occurrences. It has no warning code as it is emerging from core compiler which just writes to stderr without failing. The appropriate warning code is |
Thanks!!! |
Installer build with GCC failed:
This PR fixes the build.