Skip to content
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

fix warnings #2944

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace Aws
AWS_UNREFERENCED_PARAM(AMZN_XML_CONTENT_TYPE);
}

virtual ~AmazonSerializableWebServiceRequest() {}
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: space before braces. do we actually need braces in this case at all?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, there currently is no consistency with having or not having the empty {}

Copy link
Member Author

Choose a reason for hiding this comment

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

should I remove all of them

virtual ~AmazonSerializableWebServiceRequest() override{}

/**
* Convert payload into String.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Aws
{
}

virtual ~AmazonStreamingWebServiceRequest();
virtual ~AmazonStreamingWebServiceRequest() override;

/**
* Get the user set stream
Expand Down Expand Up @@ -72,7 +72,7 @@ namespace Aws
/**
* Override this method to put data members from a subclass into the headers collection.
*/
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); };
virtual Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const { return Aws::Http::HeaderValueCollection(); }

private:
std::shared_ptr<Aws::IOStream> m_bodyStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ namespace Aws

virtual const char* GetServiceRequestName() const = 0;

inline virtual void SetServiceSpecificParameters(const std::shared_ptr<Http::ServiceSpecificParameters>& serviceSpecificParameters) const { m_serviceSpecificParameters = serviceSpecificParameters; };
inline virtual void SetServiceSpecificParameters(const std::shared_ptr<Http::ServiceSpecificParameters>& serviceSpecificParameters) const { m_serviceSpecificParameters = serviceSpecificParameters; }

inline virtual std::shared_ptr<Http::ServiceSpecificParameters> GetServiceSpecificParameters() const { return m_serviceSpecificParameters; };
inline virtual std::shared_ptr<Http::ServiceSpecificParameters> GetServiceSpecificParameters() const { return m_serviceSpecificParameters; }

using EndpointParameters = Aws::Vector<Aws::Endpoint::EndpointParameter>;
virtual EndpointParameters GetEndpointContextParams() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace Aws
{
public:
DefaultBearerTokenProviderChain();
virtual ~DefaultBearerTokenProviderChain() = default;
virtual ~DefaultBearerTokenProviderChain() override = default;

/**
* Return bearer token, implementation of a base class interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Aws
: m_bearerTokenProvider(bearerTokenProvider)
{}

virtual ~AWSAuthBearerSigner() {};
virtual ~AWSAuthBearerSigner() override {}

/**
* Return the signer's name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace Aws
const char* serviceName, const Aws::String& region, PayloadSigningPolicy signingPolicy = PayloadSigningPolicy::RequestDependent,
bool urlEscapePath = true, Aws::Auth::AWSSigningAlgorithm signingAlgorithm = Aws::Auth::AWSSigningAlgorithm::SIGV4);

virtual ~AWSAuthV4Signer();
virtual ~AWSAuthV4Signer() override;

/**
* AWSAuthV4signer's implementation of virtual function from base class
Expand Down
2 changes: 1 addition & 1 deletion src/aws-cpp-sdk-core/include/aws/core/client/AWSClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace Aws
const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);

virtual ~AWSClient() { };
virtual ~AWSClient() { }

/**
* Generates a signed Uri using the injected signer. for the supplied uri and http method. expirationInSeconds defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Aws
const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);

virtual ~AWSJsonClient() = default;
virtual ~AWSJsonClient() override = default;

protected:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace Aws
public:
AWSUrlPresigner(const AWSClient& client);

virtual ~AWSUrlPresigner() {};
virtual ~AWSUrlPresigner() {}

/**
* Generates a signed Uri using the injected signer, for the supplied uri and http method. expirationInSeconds defaults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Aws
const std::shared_ptr<Aws::Auth::AWSAuthSignerProvider>& signerProvider,
const std::shared_ptr<AWSErrorMarshaller>& errorMarshaller);

virtual ~AWSXMLClient() = default;
virtual ~AWSXMLClient() override = default;

protected:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace Aws
{
public:
DefaultRetryQuotaContainer();
virtual ~DefaultRetryQuotaContainer() = default;
virtual ~DefaultRetryQuotaContainer() override = default;
virtual bool AcquireRetryQuota(int capacityAmount) override;
virtual bool AcquireRetryQuota(const AWSError<CoreErrors>& error) override;
virtual void ReleaseRetryQuota(int capacityAmount) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace Aws
*/
AWSConfigFileProfileConfigLoader(const Aws::String& fileName, bool useProfilePrefix = false);

virtual ~AWSConfigFileProfileConfigLoader() = default;
virtual ~AWSConfigFileProfileConfigLoader() override= default;

/**
* File path being used for the config loader.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace Aws
/**
* Gets all profiles from the configuration file.
*/
inline const Aws::Map<Aws::String, Aws::Config::Profile> &GetProfiles() const { return m_profiles; };
inline const Aws::Map<Aws::String, Aws::Config::Profile> &GetProfiles() const { return m_profiles; }

/**
* the timestamp from the last time the profile information was loaded from file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Aws
*/
EC2InstanceProfileConfigLoader(const std::shared_ptr<Aws::Internal::EC2MetadataClient>& = nullptr);

virtual ~EC2InstanceProfileConfigLoader() = default;
virtual ~EC2InstanceProfileConfigLoader() override = default;

protected:
virtual bool LoadInternal() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace Aws
using EndpointAttributes = Internal::Endpoint::EndpointAttributes;

virtual ~AWSEndpoint()
{};
{}

Aws::String GetURL() const;
void SetURL(Aws::String url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace Aws
class AWS_CORE_API EndpointAuthScheme
{
public:
virtual ~EndpointAuthScheme(){};
virtual ~EndpointAuthScheme(){}

inline const Aws::String& GetName() const
{
Expand Down
66 changes: 65 additions & 1 deletion src/aws-cpp-sdk-core/include/aws/core/http/HttpResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,70 @@ namespace Aws
case HttpResponseCode::NETWORK_READ_TIMEOUT:
case HttpResponseCode::NETWORK_CONNECT_TIMEOUT:
return true;
case HttpResponseCode::REQUEST_NOT_MADE:
jmklix marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the actual warning? id rather not list all enum values if possible

Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like this:

warning: 15 enumeration values not explicitly handled in switch: 'AWS_MQTT5_PT_RESERVED', 'AWS_MQTT5_PT_CONNECT', 'AWS_MQTT5_PT_CONNACK'..

case HttpResponseCode::CONTINUE:
case HttpResponseCode::SWITCHING_PROTOCOLS:
case HttpResponseCode::PROCESSING:
case HttpResponseCode::OK:
case HttpResponseCode::CREATED:
case HttpResponseCode::ACCEPTED:
case HttpResponseCode::NON_AUTHORITATIVE_INFORMATION:
case HttpResponseCode::NO_CONTENT:
case HttpResponseCode::RESET_CONTENT:
case HttpResponseCode::PARTIAL_CONTENT:
case HttpResponseCode::MULTI_STATUS:
case HttpResponseCode::ALREADY_REPORTED:
case HttpResponseCode::IM_USED:
case HttpResponseCode::MULTIPLE_CHOICES:
case HttpResponseCode::MOVED_PERMANENTLY:
case HttpResponseCode::FOUND:
case HttpResponseCode::SEE_OTHER:
case HttpResponseCode::NOT_MODIFIED:
case HttpResponseCode::USE_PROXY:
case HttpResponseCode::SWITCH_PROXY:
case HttpResponseCode::TEMPORARY_REDIRECT:
case HttpResponseCode::PERMANENT_REDIRECT:
case HttpResponseCode::BAD_REQUEST:
case HttpResponseCode::UNAUTHORIZED:
case HttpResponseCode::PAYMENT_REQUIRED:
case HttpResponseCode::FORBIDDEN:
case HttpResponseCode::NOT_FOUND:
case HttpResponseCode::METHOD_NOT_ALLOWED:
case HttpResponseCode::NOT_ACCEPTABLE:
case HttpResponseCode::PROXY_AUTHENTICATION_REQUIRED:
case HttpResponseCode::CONFLICT:
case HttpResponseCode::GONE:
case HttpResponseCode::LENGTH_REQUIRED:
case HttpResponseCode::PRECONDITION_FAILED:
case HttpResponseCode::REQUEST_ENTITY_TOO_LARGE:
case HttpResponseCode::REQUEST_URI_TOO_LONG:
case HttpResponseCode::UNSUPPORTED_MEDIA_TYPE:
case HttpResponseCode::REQUESTED_RANGE_NOT_SATISFIABLE:
case HttpResponseCode::EXPECTATION_FAILED:
case HttpResponseCode::IM_A_TEAPOT:
case HttpResponseCode::METHOD_FAILURE:
case HttpResponseCode::UNPROC_ENTITY:
case HttpResponseCode::LOCKED:
case HttpResponseCode::FAILED_DEPENDENCY:
case HttpResponseCode::UPGRADE_REQUIRED:
case HttpResponseCode::PRECONDITION_REQUIRED:
case HttpResponseCode::REQUEST_HEADER_FIELDS_TOO_LARGE:
case HttpResponseCode::NO_RESPONSE:
case HttpResponseCode::RETRY_WITH:
case HttpResponseCode::BLOCKED:
case HttpResponseCode::REDIRECT:
case HttpResponseCode::REQUEST_HEADER_TOO_LARGE:
case HttpResponseCode::CERT_ERROR:
case HttpResponseCode::NO_CERT:
case HttpResponseCode::HTTP_TO_HTTPS:
case HttpResponseCode::CLIENT_CLOSED_TO_REQUEST:
case HttpResponseCode::NOT_IMPLEMENTED:
case HttpResponseCode::HTTP_VERSION_NOT_SUPPORTED:
case HttpResponseCode::VARIANT_ALSO_NEGOTIATES:
case HttpResponseCode::INSUFFICIENT_STORAGE:
case HttpResponseCode::LOOP_DETECTED:
case HttpResponseCode::NOT_EXTENDED:
case HttpResponseCode::NETWORK_AUTHENTICATION_REQUIRED:
default:
return false;
}
Expand Down Expand Up @@ -203,7 +267,7 @@ namespace Aws
* It isn't pure virtual for backwards compatiblity reasons, but the StandardHttpResponse used by default in the SDK
* implements the move.
*/
virtual void AddHeader(const Aws::String& headerName, Aws::String&& headerValue) { AddHeader(headerName, headerValue); };
virtual void AddHeader(const Aws::String& headerName, Aws::String&& headerValue) { AddHeader(headerName, headerValue); }
/**
* Sets the content type header on the http response object.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/aws-cpp-sdk-core/include/aws/core/utils/crypto/HMAC.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ namespace Aws
class AWS_CORE_API HMAC
{
public:
HMAC() {};
virtual ~HMAC() {};
HMAC() {}
virtual ~HMAC() {}

/**
* Calculates an HMAC digest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace Aws
* Initializes platform crypto libs.
*/
Sha256();
virtual ~Sha256();
virtual ~Sha256() override;

/**
* Calculates a SHA256 Hash digest (not hex encoded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ namespace Aws
* initializes platform specific libs.
*/
Sha256HMAC();
virtual ~Sha256HMAC();
virtual ~Sha256HMAC() override;

/**
* Calculates a SHA256 HMAC digest (not hex encoded)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace Aws
m_eventHeaderStaticValue.boolValue = aws_event_stream_header_value_as_bool(header) != 0;
break;
case EventHeaderType::BYTE:
m_eventHeaderStaticValue.byteValue = aws_event_stream_header_value_as_byte(header);
m_eventHeaderStaticValue.byteValue = static_cast<uint8_t>(aws_event_stream_header_value_as_byte(header));
break;
case EventHeaderType::INT16:
m_eventHeaderStaticValue.int16Value = aws_event_stream_header_value_as_int16(header);
Expand All @@ -81,11 +81,12 @@ namespace Aws
assert(header->header_value_len == 16u);
m_eventHeaderVariableLengthValue = ByteBuffer(static_cast<uint8_t*>(aws_event_stream_header_value_as_uuid(header).buffer), header->header_value_len);
break;
case EventHeaderType::UNKNOWN:
default:
AWS_LOG_ERROR(CLASS_TAG, "Encountered unknown type of header.");
break;
}
};
}

EventHeaderValue(const Aws::String& s) :
m_eventHeaderType(EventHeaderType::STRING),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Aws
{
public:
DefaultCRTLogSystem(LogLevel logLevel);
virtual ~DefaultCRTLogSystem() = default;
virtual ~DefaultCRTLogSystem() override = default;

DefaultCRTLogSystem(DefaultCRTLogSystem&&) = delete;
DefaultCRTLogSystem(const DefaultCRTLogSystem&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Aws
*/
DefaultLogSystem(LogLevel logLevel, const Aws::String& filenamePrefix);

virtual ~DefaultLogSystem();
virtual ~DefaultLogSystem() override;

/**
* Flushes buffered messages to the file system.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace Aws
* Initializes log system with logLevel
*/
FormattedLogSystem(LogLevel logLevel);
virtual ~FormattedLogSystem() = default;
virtual ~FormattedLogSystem() override = default;

/**
* Gets the currently configured log level.
Expand Down Expand Up @@ -58,7 +58,7 @@ namespace Aws
/**
* Stops logging on this logger without destroying the object.
*/
virtual void Stop() override { return SetLogLevel(Aws::Utils::Logging::LogLevel::Off); };
virtual void Stop() override { return SetLogLevel(Aws::Utils::Logging::LogLevel::Off); }
protected:
/**
* This is the method that most logger implementations will want to override.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace Aws
/**
* Stops logging on this logger without destroying the object.
*/
virtual void Stop() { return; };
virtual void Stop() { return; }
};

} // namespace Logging
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Aws
{
public:
DefaultExecutor() : m_state(State::Free) {}
~DefaultExecutor();
~DefaultExecutor() override;

void WaitUntilStopped() override;
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace Aws
/**
* Call to wait until all tasks have finished.
*/
virtual void WaitUntilStopped() { return; };
virtual void WaitUntilStopped() { return; }

protected:
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Aws
{
public:
PooledThreadExecutor(size_t poolSize, OverflowPolicy overflowPolicy = OverflowPolicy::QUEUE_TASKS_EVENLY_ACROSS_THREADS);
~PooledThreadExecutor();
~PooledThreadExecutor() override;

/**
* Rule of 5 stuff.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const char GeneralHTTPCredentialsProvider::AWS_EKS_CONTAINER_HOST[] = "169.
const char GeneralHTTPCredentialsProvider::AWS_EKS_CONTAINER_HOST_IPV6[] = "fd00:ec2::23";


bool IsAllowedIp(const Aws::String& authority)
static bool IsAllowedIp(const Aws::String& authority)
{
// address is an ECS / EKS container host
if (authority == GeneralHTTPCredentialsProvider::AWS_ECS_CONTAINER_HOST) // ECS container host
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ static void WriteBigEndian(Aws::String& str, uint64_t n)
int shift = 56;
while(shift >= 0)
{
str.push_back((n >> shift) & 0xFF);
str.push_back(static_cast<char>((n >> shift) & 0xFF));
shift -= 8;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/aws-cpp-sdk-core/source/client/AWSUrlPresigner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Aws::Client::AWSAuthSigner* AWSUrlPresigner::GetSignerByName(const char* name) c
return m_awsClient.GetSignerByName(name);
}

std::shared_ptr<Aws::Http::HttpRequest>
static std::shared_ptr<Aws::Http::HttpRequest>
ConvertToRequestForPresigning(const Aws::AmazonWebServiceRequest& request,
const Aws::Http::URI& uri,
Aws::Http::HttpMethod method,
Expand Down Expand Up @@ -179,7 +179,7 @@ Aws::String AWSUrlPresigner::GeneratePresignedUrl(const Aws::Endpoint::AWSEndpoi
}
}

return GeneratePresignedUrl(uri, method, signerRegionOverride, signerServiceNameOverride, signerName, customizedHeaders, expirationInSeconds, serviceSpecificParameters);
return GeneratePresignedUrl(uri, method, signerRegionOverride, signerServiceNameOverride, signerName, customizedHeaders, static_cast<long long>(expirationInSeconds), serviceSpecificParameters);
}

Aws::String AWSUrlPresigner::GeneratePresignedUrl(const Aws::AmazonWebServiceRequest& request,
Expand Down
Loading
Loading