Skip to content

assert issues #33

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

Merged
merged 1 commit into from
Jun 3, 2019
Merged

assert issues #33

merged 1 commit into from
Jun 3, 2019

Conversation

graebm
Copy link
Contributor

@graebm graebm commented Jun 3, 2019

  • Add missing #include <assert.h> to enum-handling cpp files.
  • Change assert() -> AWS_ASSERT() in input-validating discovery code.
  • Run formatter on discovery code.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@graebm graebm requested review from JonathanHenson and a team June 3, 2019 17:54
@@ -18,6 +18,8 @@
#include <aws/crt/StlAllocator.h>
#include <aws/crt/StringUtils.h>

#include <assert.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this required? Why not just use AWS_ASSERT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When transforming a string -> enum, if we don't recognize the string that the service returned, it does assert(0); return static_cast<JobStatus>(-1);

It's not something we want to be fatal in a release product. I asked Jonathan if he wanted the assert removed, or preserved and he wanted it preserved here.

Sorry for merging before I noticed this comment

Choose a reason for hiding this comment

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

/home/kevin/deviceagentcpp-build/aws-iot-device-sdk-cpp-v2-prefix/src/aws-iot-device-sdk-cpp-v2/discovery/source/DiscoveryClient.cpp:32:47: error: ‘AWS_ASSERT’ was not declared in this scope

Still an issue I believe

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This ought to work, the include chain is: DiscoveryClient.cpp -> #include <aws/crt/Types.h> -> #include <aws/common/common.h> -> #include <aws/common/assert.inl> ->#define AWS_ASSERT

Have you updated to aws-crt-cpp v0.4.0?

@graebm graebm merged commit 2a615fc into master Jun 3, 2019
@graebm graebm deleted the assert-fix branch June 3, 2019 18:11
@Kevin-Tacheny
Copy link

Kevin-Tacheny commented Jun 4, 2019 via email

yourslab pushed a commit to yourslab/aws-iot-device-sdk-cpp-v2 that referenced this pull request Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants