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 useless-cast warning #1090

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion include/aws/common/array_list.inl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ AWS_STATIC_IMPL
void aws_array_list_clean_up_secure(struct aws_array_list *AWS_RESTRICT list) {
AWS_PRECONDITION(AWS_IS_ZEROED(*list) || aws_array_list_is_valid(list));
if (list->alloc && list->data) {
aws_secure_zero((void *)list->data, list->current_size);
aws_secure_zero(list->data, list->current_size);
aws_mem_release(list->alloc, list->data);
}

Expand Down
7 changes: 7 additions & 0 deletions include/aws/common/math.inl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ AWS_EXTERN_C_BEGIN
# pragma warning(disable : 4127) /*Disable "conditional expression is constant" */
#endif /* _MSC_VER */

#ifdef __cplusplus
# if defined(__GNUC__)
# pragma GCC diagnostic push
Copy link
Contributor

Choose a reason for hiding this comment

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

You also need to pop
Otherwise, any code that includes the .h file that includes this .inl file will have these warnings disabled

# pragma GCC diagnostic ignored "-Wuseless-cast"
# endif
#endif

AWS_STATIC_IMPL uint64_t aws_sub_u64_saturating(uint64_t a, uint64_t b) {
return a <= b ? 0 : a - b;
}
Expand Down
Loading