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

Commit 59a12ca

Browse files
authored
Fix build failures with clang 13 rc1 (#9171)
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.
1 parent aed122f commit 59a12ca

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

  • src/corehost/cli/json/casablanca/include/cpprest/details

src/corehost/cli/json/casablanca/include/cpprest/details/SafeInt3.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,7 @@ template < typename T > class SafeCastHelper < bool, T, CastToBool >
13171317
static void CastThrow( bool b, T& t ) SAFEINT_CPP_THROW
13181318
{
13191319
b = !!t;
1320+
(void)b;
13201321
}
13211322
};
13221323

0 commit comments

Comments
 (0)