Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Conversation

omajid
Copy link
Member

@omajid omajid commented Aug 27, 2021

Clang 13 now produces an error in json/casablanca because a function
argument is not used:

In file included from /core-setup/src/corehost/cli/deps_format.cpp:6:
In file included from /core-setup/src/corehost/cli/deps_format.h:14:
In file included from /core-setup/src/corehost/cli/fxr/../json/casablanca/include/cpprest/json.h:36:
In file included from /core-setup/src/corehost/cli/fxr/../json/casablanca/include/cpprest/details/basic_types.h:41:
/core-setup/src/corehost/cli/fxr/../json/casablanca/include/cpprest/details/SafeInt3.hpp:1317:33: error: parameter 'b' set but not used [-Werror,-Wunused-but-set-parameter]
    static void CastThrow( bool b, T& t ) SAFEINT_CPP_THROW
                                ^
1 error generated.
gmake[2]: *** [cli/fxr/CMakeFiles/hostfxr.dir/build.make:76: cli/fxr/CMakeFiles/hostfxr.dir/__/deps_format.cpp.o] Error 1

Cast the argument to void to avoid this warning/error.

Clang 13 now produces an error in json/casablanca because a function
argument is not used:

    In file included from /core-setup/src/corehost/cli/deps_format.cpp:6:
    In file included from /core-setup/src/corehost/cli/deps_format.h:14:
    In file included from /core-setup/src/corehost/cli/fxr/../json/casablanca/include/cpprest/json.h:36:
    In file included from /core-setup/src/corehost/cli/fxr/../json/casablanca/include/cpprest/details/basic_types.h:41:
    /core-setup/src/corehost/cli/fxr/../json/casablanca/include/cpprest/details/SafeInt3.hpp:1317:33: error: parameter 'b' set but not used [-Werror,-Wunused-but-set-parameter]
        static void CastThrow( bool b, T& t ) SAFEINT_CPP_THROW
                                    ^
    1 error generated.
    gmake[2]: *** [cli/fxr/CMakeFiles/hostfxr.dir/build.make:76: cli/fxr/CMakeFiles/hostfxr.dir/__/deps_format.cpp.o] Error 1

Cast the argument to void to avoid this warning/error.
@omajid omajid changed the title Fix build failures with clang 13 rc1 [release/3.1] Fix build failures with clang 13 rc1 Aug 27, 2021
@Anipik
Copy link

Anipik commented Sep 13, 2021

cc @NikolaMilosavljevic can you review this change

@omajid
Copy link
Member Author

omajid commented Sep 27, 2021

Ping. Anyone want to review this?

@Anipik
Copy link

Anipik commented Oct 8, 2021

cc @jeffschwMSFT @aik-jahoda

@jeffschwMSFT
Copy link
Member

Adding @janvorli and @mangod9

@mangod9
Copy link
Member

mangod9 commented Oct 8, 2021

The change itself looks innocuous, but I am not sure about whether updating to clang 13 is required for rc1?

@janvorli
Copy link
Member

janvorli commented Oct 8, 2021

@mangod9 the "rc1" refers to clang 13 rc1, not .NET rc1.

@safern
Copy link
Member

safern commented Jan 11, 2022

Is this change still needed?

@omajid
Copy link
Member Author

omajid commented Jan 11, 2022

It would be nice to include this to support building against clang 13. That said, this change is now known to be incomplete; we will need the changes from dotnet/runtime#63314 as well.

@safern
Copy link
Member

safern commented Jan 11, 2022

I see. Should we then close this PR until it can be worked on to get it to a complete state?

@omajid omajid marked this pull request as draft January 11, 2022 21:54
@omajid
Copy link
Member Author

omajid commented Jan 11, 2022

I converetd the PR to draft, let me know if it's still better to close it until I get a chance to re-visit it.

@safern
Copy link
Member

safern commented Jan 11, 2022

That's good. Thanks, it just helps to have only open PRs on these repos that are targeting the next servicing release.

@omajid
Copy link
Member Author

omajid commented Jan 20, 2022

Uh.. I opened #9197 yesterday which fixes the same issue differently. Any thoughts which approach is better?

@omajid omajid marked this pull request as ready for review May 26, 2022 21:52
@omajid
Copy link
Member Author

omajid commented May 26, 2022

Any thought about this?

@NikolaMilosavljevic
Copy link
Member

@omajid where do you see this error? I presume this is a local dev build, as we do not get this error in official builds.

@NikolaMilosavljevic
Copy link
Member

cc @vitek-karas

@omajid
Copy link
Member Author

omajid commented May 26, 2022

@NikolaMilosavljevic I am one of the maintainer of the .NET Core 3.1 package in Fedora. Building core-setup fails on Fedora 36 (which uses clang 14) because core-setup enables -Werror and then has code that produces warnings.

We should either fix the warnings, or disable -Werror.

The issue affects other Linux distributions as well, including Alpine: https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/testing/dotnet31-build (see core-setup_clang13-no-werror.patch)

@NikolaMilosavljevic
Copy link
Member

@vitek-karas this is host code - can you take a look?

@vitek-karas
Copy link
Member

Actually @janvorli is a much better for this type of change.

One question - the linked change in the runtime dotnet/runtime#63314 looks different - is there a reason for this difference?

@omajid
Copy link
Member Author

omajid commented May 27, 2022

@vitek-karas There's a few individual fixes needed to get all of .NET Core 3.1 building under clang 13.

This fix, which updates the SafeInt3.hpp file, doesn't apply in runtime. As far as I can tell, there's no SafeInt3.hpp in runtime at all.

The rest of the fixes in dotnet/runtime#63314 take care of the changes that would be needed in core-setup coreclr and corefx for 3.1.

@omajid
Copy link
Member Author

omajid commented Jun 23, 2022

Any updates on this? Is this okay to merge?

@jeffschwMSFT
Copy link
Member

we need to take for approval. I will mark it as such.

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Jun 24, 2022
Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

Approved. We will take for consideration in 3.1.x

@omajid
Copy link
Member Author

omajid commented Jun 24, 2022

Thanks!

@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jun 28, 2022
@rbhanda rbhanda added this to the 3.1.29 milestone Jun 28, 2022
@carlossanlop carlossanlop merged commit 59a12ca into dotnet:release/3.1 Jul 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Host Servicing-approved Approved for servicing release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants