From 9bff19e021e64062992d0b82f5fd84e606125306 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 3 Jun 2024 15:54:28 -0700 Subject: [PATCH 1/5] fix compile --- source/s3_auto_ranged_get.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/s3_auto_ranged_get.c b/source/s3_auto_ranged_get.c index a71d418e3..86aad45fe 100644 --- a/source/s3_auto_ranged_get.c +++ b/source/s3_auto_ranged_get.c @@ -562,7 +562,7 @@ static bool s_check_empty_file_download_error(struct aws_s3_request *failed_requ /* XML response */ struct aws_byte_cursor xml_doc = aws_byte_cursor_from_buf(&failed_body); const char *path_to_size[] = {"Error", "ActualObjectSize", NULL}; - struct aws_byte_cursor size = {0}; + struct aws_byte_cursor size = {0, 0}; aws_xml_get_body_at_path(failed_request->allocator, xml_doc, path_to_size, &size); if (aws_byte_cursor_eq_c_str(&size, "0")) { return true; From b714628288487839bacdd921b2add7595ef28f73 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 3 Jun 2024 16:00:47 -0700 Subject: [PATCH 2/5] fix clang3 compile error --- source/s3_auto_ranged_put.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/s3_auto_ranged_put.c b/source/s3_auto_ranged_put.c index cb57b9d78..6171fe138 100644 --- a/source/s3_auto_ranged_put.c +++ b/source/s3_auto_ranged_put.c @@ -771,7 +771,7 @@ static int s_verify_part_matches_checksum( return AWS_OP_ERR; } - struct aws_byte_buf encoded_checksum = {0}; + struct aws_byte_buf encoded_checksum = {0, 0}; int return_status = AWS_OP_SUCCESS; @@ -1457,7 +1457,7 @@ static void s_s3_auto_ranged_put_request_finished( struct aws_byte_cursor xml_doc = aws_byte_cursor_from_buf(&request->send_data.response_body); /* Find the upload id for this multipart upload. */ - struct aws_byte_cursor upload_id = {0}; + struct aws_byte_cursor upload_id = {0, 0}; const char *xml_path[] = {"InitiateMultipartUploadResult", "UploadId", NULL}; aws_xml_get_body_at_path(meta_request->allocator, xml_doc, xml_path, &upload_id); @@ -1588,7 +1588,7 @@ static void s_s3_auto_ranged_put_request_finished( */ /* Grab the ETag for the entire object, and set it as a header. */ - struct aws_byte_cursor etag_header_value = {0}; + struct aws_byte_cursor etag_header_value = {0, 0}; const char *xml_path[] = {"CompleteMultipartUploadResult", "ETag", NULL}; aws_xml_get_body_at_path(meta_request->allocator, xml_doc, xml_path, &etag_header_value); From 12a17d08e8ac03ca4db9e18f383e095a00bc9e6f Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 3 Jun 2024 16:06:03 -0700 Subject: [PATCH 3/5] fix compile error --- source/s3_auto_ranged_put.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/s3_auto_ranged_put.c b/source/s3_auto_ranged_put.c index 6171fe138..0ffffbf70 100644 --- a/source/s3_auto_ranged_put.c +++ b/source/s3_auto_ranged_put.c @@ -771,7 +771,7 @@ static int s_verify_part_matches_checksum( return AWS_OP_ERR; } - struct aws_byte_buf encoded_checksum = {0, 0}; + struct aws_byte_buf encoded_checksum = {0, 0, 0, 0}; int return_status = AWS_OP_SUCCESS; From 47cf8e5c03e6a3db855a5d4e104ebb07f9d3a492 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Mon, 3 Jun 2024 16:12:43 -0700 Subject: [PATCH 4/5] setup builder for clang3 --- .github/workflows/ci.yml | 4 ++-- source/s3_copy_object.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 060729ddc..697863208 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,8 @@ on: - 'main' env: - BUILDER_VERSION: v0.9.55 - BUILDER_SOURCE: releases + BUILDER_VERSION: clang_path + BUILDER_SOURCE: channels BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net PACKAGE_NAME: aws-c-s3 LINUX_BASE_IMAGE: ubuntu-18-x64 diff --git a/source/s3_copy_object.c b/source/s3_copy_object.c index 15ed2ec0f..87ea1b5f7 100644 --- a/source/s3_copy_object.c +++ b/source/s3_copy_object.c @@ -544,7 +544,7 @@ static struct aws_string *s_etag_new_from_upload_part_copy_response( struct aws_byte_buf *response_body) { struct aws_byte_cursor xml_doc = aws_byte_cursor_from_buf(response_body); - struct aws_byte_cursor etag_within_xml_quotes = {0}; + struct aws_byte_cursor etag_within_xml_quotes = {0, 0}; const char *xml_path[] = {"CopyPartResult", "ETag", NULL}; aws_xml_get_body_at_path(allocator, xml_doc, xml_path, &etag_within_xml_quotes); @@ -666,7 +666,7 @@ static void s_s3_copy_object_request_finished( struct aws_byte_cursor xml_doc = aws_byte_cursor_from_buf(&request->send_data.response_body); /* Find the upload id for this multipart upload. */ - struct aws_byte_cursor upload_id = {0}; + struct aws_byte_cursor upload_id = {0, 0}; const char *xml_path[] = {"InitiateMultipartUploadResult", "UploadId", NULL}; aws_xml_get_body_at_path(meta_request->allocator, xml_doc, xml_path, &upload_id); @@ -754,7 +754,7 @@ static void s_s3_copy_object_request_finished( struct aws_byte_cursor xml_doc = aws_byte_cursor_from_buf(&request->send_data.response_body); /* Grab the ETag for the entire object, and set it as a header. */ - struct aws_byte_cursor etag_header_value = {0}; + struct aws_byte_cursor etag_header_value = {0, 0}; const char *xml_path[] = {"CompleteMultipartUploadResult", "ETag", NULL}; aws_xml_get_body_at_path(meta_request->allocator, xml_doc, xml_path, &etag_header_value); if (etag_header_value.len > 0) { From a51d29bd30134e002e56d7c2ea5eab30ef3c87e6 Mon Sep 17 00:00:00 2001 From: Zhihui Xia Date: Tue, 4 Jun 2024 09:28:01 -0700 Subject: [PATCH 5/5] clean up --- source/s3_meta_request.c | 2 +- source/s3_request_messages.c | 2 +- source/s3_util.c | 2 +- tests/s3_asyncwrite_tests.c | 4 ++-- tests/s3_util_tests.c | 8 ++++---- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/s3_meta_request.c b/source/s3_meta_request.c index c27f15efc..4fb87ed14 100644 --- a/source/s3_meta_request.c +++ b/source/s3_meta_request.c @@ -1524,7 +1524,7 @@ static int s_s3_meta_request_error_code_from_response(struct aws_s3_request *req if (request->send_data.response_body.len > 0) { /* Attempt to read as XML, it's fine if this fails. */ struct aws_byte_cursor xml_doc = aws_byte_cursor_from_buf(&request->send_data.response_body); - struct aws_byte_cursor error_code_string = {0}; + struct aws_byte_cursor error_code_string = {0, 0}; const char *xml_path[] = {"Error", "Code", NULL}; if (aws_xml_get_body_at_path(request->allocator, xml_doc, xml_path, &error_code_string) == AWS_OP_SUCCESS) { /* Found an string! Map it to CRT error code if retry-able. */ diff --git a/source/s3_request_messages.c b/source/s3_request_messages.c index 0551b3a92..94dbbab3b 100644 --- a/source/s3_request_messages.c +++ b/source/s3_request_messages.c @@ -465,7 +465,7 @@ struct aws_http_message *aws_s3_get_source_object_size_message_new( /* From this point forward, the format is {bucket}/{key} - split components.*/ - struct aws_byte_cursor source_bucket = {0}; + struct aws_byte_cursor source_bucket = {0, 0}; if (aws_byte_cursor_next_split(&request_path, '/', &source_bucket)) { aws_byte_cursor_advance(&request_path, source_bucket.len); diff --git a/source/s3_util.c b/source/s3_util.c index 04870e876..be334c24e 100644 --- a/source/s3_util.c +++ b/source/s3_util.c @@ -529,7 +529,7 @@ int aws_s3_parse_request_range_header( } aws_byte_cursor_advance(&range_header_value, range_header_start.len); - struct aws_byte_cursor substr = {0}; + struct aws_byte_cursor substr = {0, 0}; /* parse start range */ if (!aws_byte_cursor_next_split(&range_header_value, '-', &substr)) { return aws_raise_error(AWS_ERROR_S3_INVALID_RANGE_HEADER); diff --git a/tests/s3_asyncwrite_tests.c b/tests/s3_asyncwrite_tests.c index 49a7cc64c..7363c4cbd 100644 --- a/tests/s3_asyncwrite_tests.c +++ b/tests/s3_asyncwrite_tests.c @@ -318,7 +318,7 @@ static int s_test_s3_asyncwrite_tolerate_empty_writes(struct aws_allocator *allo struct aws_byte_cursor source_cursor = aws_byte_cursor_from_buf(&tester.source_buf); /* empty write at start */ - struct aws_byte_cursor empty_data = {0}; + struct aws_byte_cursor empty_data = {0, 0}; ASSERT_SUCCESS(s_write(&tester, empty_data, false /*eof*/)); /* write half the data */ @@ -454,7 +454,7 @@ static int s_test_s3_asyncwrite_fails_if_write_after_eof(struct aws_allocator *a ASSERT_SUCCESS(s_write(&tester, aws_byte_cursor_from_buf(&tester.source_buf), true /*eof*/)); /* Any more writes should fail with INVALID_STATE error */ - struct aws_byte_cursor empty_cursor = {0}; + struct aws_byte_cursor empty_cursor = {0, 0}; struct aws_future_void *write_future = aws_s3_meta_request_write(tester.meta_request, empty_cursor, true /*eof*/); ASSERT_TRUE(aws_future_void_wait(write_future, TIMEOUT_NANOS)); ASSERT_INT_EQUALS(AWS_ERROR_INVALID_STATE, aws_future_void_get_error(write_future)); diff --git a/tests/s3_util_tests.c b/tests/s3_util_tests.c index 511e3b346..0dc9bf878 100644 --- a/tests/s3_util_tests.c +++ b/tests/s3_util_tests.c @@ -693,7 +693,7 @@ static int s_test_s3_aws_xml_get_body_at_path(struct aws_allocator *allocator, v /* Ensure we can successfully look up */ { - struct aws_byte_cursor error_code = {0}; + struct aws_byte_cursor error_code = {0, 0}; const char *xml_path[] = {"Error", "Code", NULL}; ASSERT_SUCCESS(aws_xml_get_body_at_path(allocator, example_error_body, xml_path, &error_code)); @@ -702,7 +702,7 @@ static int s_test_s3_aws_xml_get_body_at_path(struct aws_allocator *allocator, v /* Ensure we fail if the beginning of the path doesn't match */ { - struct aws_byte_cursor error_code = {0}; + struct aws_byte_cursor error_code = {0, 0}; const char *xml_path[] = {"ObviouslyInvalidName", "Code", NULL}; ASSERT_ERROR( AWS_ERROR_STRING_MATCH_NOT_FOUND, @@ -711,7 +711,7 @@ static int s_test_s3_aws_xml_get_body_at_path(struct aws_allocator *allocator, v /* Ensure we fail if the end of the path doesn't match */ { - struct aws_byte_cursor error_code = {0}; + struct aws_byte_cursor error_code = {0, 0}; const char *xml_path[] = {"Error", "ObviouslyInvalidName", NULL}; ASSERT_ERROR( AWS_ERROR_STRING_MATCH_NOT_FOUND, @@ -720,7 +720,7 @@ static int s_test_s3_aws_xml_get_body_at_path(struct aws_allocator *allocator, v /* Ensure we fail if the document isn't valid XML */ { - struct aws_byte_cursor error_code = {0}; + struct aws_byte_cursor error_code = {0, 0}; const char *xml_path[] = {"Error", "Code", NULL}; ASSERT_ERROR( AWS_ERROR_INVALID_XML,