Skip to content

Commit f7a2e11

Browse files
committed
Fix some compiler warnings
.../src/scitokens_internal.h:673:25: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 673 | return std::move(result); | ~~~~~~~~~^~~~~~~~ .../src/scitokens_internal.h:673:25: note: remove 'std::move' call .../src/scitokens_internal.cpp:633:25: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 633 | return std::move(status); | ~~~~~~~~~^~~~~~~~ .../src/scitokens_internal.cpp:633:25: note: remove 'std::move' call .../src/scitokens_internal.cpp:747:13: warning: unused variable 'next_update' [-Wunused-variable] 747 | int64_t next_update, expires; | ^~~~~~~~~~~ .../src/scitokens_internal.cpp:747:26: warning: unused variable 'expires' [-Wunused-variable] 747 | int64_t next_update, expires; | ^~~~~~~ .../test/main.cpp:442:12: warning: unused variable 'now' [-Wunused-variable] 442 | time_t now = time(NULL); | ^~~
1 parent 8302815 commit f7a2e11

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

src/scitokens_internal.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ Validator::get_public_keys_from_web(const std::string &issuer,
630630
auto cget_status = status->m_cget->perform_start(openid_metadata);
631631
status->m_continue_fetch = true;
632632
if (!cget_status.m_done) {
633-
return std::move(status);
633+
return status;
634634
}
635635
return get_public_keys_from_web_continue(std::move(status));
636636
}
@@ -744,7 +744,6 @@ std::string Validator::get_jwks(const std::string &issuer) {
744744
}
745745

746746
bool Validator::refresh_jwks(const std::string &issuer) {
747-
int64_t next_update, expires;
748747
picojson::value keys;
749748
std::unique_ptr<scitokens::AsyncStatus> status = get_public_keys_from_web(
750749
issuer, internal::SimpleCurlGet::extended_timeout);

src/scitokens_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ class Validator {
670670
}
671671
std::unique_ptr<AsyncStatus> result(new AsyncStatus());
672672
result->m_done = true;
673-
return std::move(result);
673+
return result;
674674
}
675675

676676
void add_critical_claims(const std::vector<std::string> &claims) {

test/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,6 @@ TEST_F(SerializeTest, FailDeserializeAsyncTest) {
439439
}
440440

441441
TEST_F(SerializeTest, ExplicitTime) {
442-
time_t now = time(NULL);
443442
char *err_msg = nullptr;
444443

445444
scitoken_set_serialize_profile(m_token.get(), SciTokenProfile::WLCG_1_0);

0 commit comments

Comments
 (0)