Skip to content

Commit 7e9b1a7

Browse files
author
Andrei Popescu
authored
Removes internal deprecated compiler warnings. (#758)
TokenProvider which is widely used by all OLP SDK users to request tokens uses internally TokenEndpoint and AutoRefreshingToken which are marked as deprecated and create compiler warnings. This is now filtered out by pragmas. Resolves: OLPEDGE-1768 Signed-off-by: Andrei Popescu <[email protected]>
1 parent ce1e3f9 commit 7e9b1a7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

olp-cpp-sdk-authentication/include/olp/authentication/AutoRefreshingToken.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ static constexpr auto kForceRefresh = std::chrono::seconds(0);
4747
*/
4848
class AUTHENTICATION_API AutoRefreshingToken {
4949
public:
50+
// Needed to avoid endless warnings from TokenRequest/TokenResult
51+
PORTING_PUSH_WARNINGS()
52+
PORTING_CLANG_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
53+
5054
/**
5155
* @brief Specifies the callback signature that is required
5256
* when the get token request is completed.
@@ -130,9 +134,8 @@ class AUTHENTICATION_API AutoRefreshingToken {
130134
* refreshed.
131135
* @param token_request The token request that is sent to the token endpoint.
132136
*/
133-
PORTING_PUSH_WARNINGS()
134-
PORTING_CLANG_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
135137
AutoRefreshingToken(TokenEndpoint token_endpoint, TokenRequest token_request);
138+
136139
PORTING_POP_WARNINGS()
137140

138141
private:

olp-cpp-sdk-authentication/include/olp/authentication/TokenProvider.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
#include "TokenEndpoint.h"
2929
#include "TokenResult.h"
3030

31+
// Needed to avoid endless warnings from TokenEndpoint/TokenResponse
32+
PORTING_PUSH_WARNINGS()
33+
PORTING_CLANG_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
34+
3135
namespace olp {
3236
namespace authentication {
3337
/** @file TokenProvider.h */
@@ -127,5 +131,6 @@ class TokenProvider {
127131
*/
128132
using TokenProviderDefault = TokenProvider<kDefaultMinimumValidity>;
129133

134+
PORTING_POP_WARNINGS()
130135
} // namespace authentication
131136
} // namespace olp

0 commit comments

Comments
 (0)