From 118a57ecf0f88e047bb3e75227e08adb5782074c Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Khan Date: Mon, 15 May 2023 13:31:55 -0700 Subject: [PATCH] Fix warnings in public headers (#569) --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 2 +- include/aws/io/channel.h | 3 +++ include/aws/io/channel_bootstrap.h | 3 +++ include/aws/io/event_loop.h | 3 +++ include/aws/io/host_resolver.h | 3 +++ include/aws/io/io.h | 3 +++ include/aws/io/logging.h | 3 +++ include/aws/io/message_pool.h | 3 +++ include/aws/io/pipe.h | 3 +++ include/aws/io/pkcs11.h | 3 +++ include/aws/io/retry_strategy.h | 3 +++ include/aws/io/shared_library.h | 3 +++ include/aws/io/socket.h | 3 +++ include/aws/io/socket_channel_handler.h | 3 +++ include/aws/io/statistics.h | 3 +++ include/aws/io/stream.h | 3 +++ include/aws/io/tls_channel_handler.h | 7 +++++-- 18 files changed, 52 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75b0aaeac..49f1a1467 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: - 'main' env: - BUILDER_VERSION: v0.9.40 + BUILDER_VERSION: v0.9.43 BUILDER_SOURCE: releases BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net PACKAGE_NAME: aws-c-io diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ddc3681a..cd12fa725 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,7 +177,7 @@ file(GLOB IO_SRC add_library(${PROJECT_NAME} ${LIBTYPE} ${IO_HEADERS} ${IO_SRC}) aws_set_common_properties(${PROJECT_NAME}) aws_prepare_symbol_visibility_args(${PROJECT_NAME} "AWS_IO") -aws_check_headers(${PROJECT_NAME} ${IO_HEADERS}) +aws_check_headers(${PROJECT_NAME} ${AWS_IO_HEADERS}) aws_add_sanitizers(${PROJECT_NAME}) diff --git a/include/aws/io/channel.h b/include/aws/io/channel.h index 50dc5cce2..aca73d7c6 100644 --- a/include/aws/io/channel.h +++ b/include/aws/io/channel.h @@ -10,6 +10,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + enum aws_channel_direction { AWS_CHANNEL_DIR_READ, AWS_CHANNEL_DIR_WRITE, @@ -504,5 +506,6 @@ AWS_IO_API int aws_channel_trigger_read(struct aws_channel *channel); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_CHANNEL_H */ diff --git a/include/aws/io/channel_bootstrap.h b/include/aws/io/channel_bootstrap.h index ae97ba6b4..8e28579df 100644 --- a/include/aws/io/channel_bootstrap.h +++ b/include/aws/io/channel_bootstrap.h @@ -9,6 +9,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_client_bootstrap; struct aws_socket; struct aws_socket_options; @@ -305,5 +307,6 @@ AWS_IO_API void aws_server_bootstrap_destroy_socket_listener( struct aws_socket *listener); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_CHANNEL_BOOTSTRAP_H */ diff --git a/include/aws/io/event_loop.h b/include/aws/io/event_loop.h index 32d626869..a3b552d6e 100644 --- a/include/aws/io/event_loop.h +++ b/include/aws/io/event_loop.h @@ -12,6 +12,8 @@ #include +AWS_PUSH_SANE_WARNING_LEVEL + enum aws_io_event_type { AWS_IO_EVENT_TYPE_READABLE = 1, AWS_IO_EVENT_TYPE_WRITABLE = 2, @@ -470,5 +472,6 @@ AWS_IO_API struct aws_event_loop *aws_event_loop_group_get_next_loop(struct aws_event_loop_group *el_group); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_EVENT_LOOP_H */ diff --git a/include/aws/io/host_resolver.h b/include/aws/io/host_resolver.h index 6be0245e9..8b4824224 100644 --- a/include/aws/io/host_resolver.h +++ b/include/aws/io/host_resolver.h @@ -8,6 +8,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_event_loop_group; enum aws_address_record_type { @@ -272,5 +274,6 @@ AWS_IO_API size_t aws_host_resolver_get_host_address_count( AWS_IO_API struct aws_host_resolution_config aws_host_resolver_init_default_resolution_config(void); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_HOST_RESOLVER_H */ diff --git a/include/aws/io/io.h b/include/aws/io/io.h index 2dfd392dd..0ce3f2bc8 100644 --- a/include/aws/io/io.h +++ b/include/aws/io/io.h @@ -10,6 +10,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + #define AWS_C_IO_PACKAGE_ID 1 struct aws_io_handle { @@ -271,5 +273,6 @@ AWS_IO_API void aws_io_fatal_assert_library_initialized(void); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_IO_H */ diff --git a/include/aws/io/logging.h b/include/aws/io/logging.h index a95e1d4ac..5d8a144a0 100644 --- a/include/aws/io/logging.h +++ b/include/aws/io/logging.h @@ -10,6 +10,8 @@ #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_log_channel; struct aws_log_formatter; struct aws_log_writer; @@ -32,5 +34,6 @@ enum aws_io_log_subject { AWS_LS_IO_PKCS11, AWS_IO_LS_LAST = AWS_LOG_SUBJECT_END_RANGE(AWS_C_IO_PACKAGE_ID) }; +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_LOGGING_H */ diff --git a/include/aws/io/message_pool.h b/include/aws/io/message_pool.h index 4b1e809c9..738627a39 100644 --- a/include/aws/io/message_pool.h +++ b/include/aws/io/message_pool.h @@ -7,6 +7,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_memory_pool { struct aws_allocator *alloc; struct aws_array_list stack; @@ -82,5 +84,6 @@ AWS_IO_API void aws_message_pool_release(struct aws_message_pool *msg_pool, struct aws_io_message *message); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_MESSAGE_POOL_H */ diff --git a/include/aws/io/pipe.h b/include/aws/io/pipe.h index 507565054..ab9746cc4 100644 --- a/include/aws/io/pipe.h +++ b/include/aws/io/pipe.h @@ -9,6 +9,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_event_loop; struct aws_pipe_read_end { @@ -144,5 +146,6 @@ int aws_pipe_get_unique_name(char *dst, size_t dst_size); #endif AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_PIPE_H */ diff --git a/include/aws/io/pkcs11.h b/include/aws/io/pkcs11.h index 862f06310..e23192f1f 100644 --- a/include/aws/io/pkcs11.h +++ b/include/aws/io/pkcs11.h @@ -6,6 +6,8 @@ */ #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_allocator; /** @@ -90,5 +92,6 @@ AWS_IO_API void aws_pkcs11_lib_release(struct aws_pkcs11_lib *pkcs11_lib); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_PKCS11_H */ diff --git a/include/aws/io/retry_strategy.h b/include/aws/io/retry_strategy.h index 4d7a26f7e..8f15d207f 100644 --- a/include/aws/io/retry_strategy.h +++ b/include/aws/io/retry_strategy.h @@ -9,6 +9,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_retry_strategy; struct aws_retry_token; struct aws_event_loop_group; @@ -232,5 +234,6 @@ AWS_IO_API struct aws_retry_strategy *aws_retry_strategy_new_standard( const struct aws_standard_retry_options *config); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_CLIENT_RETRY_STRATEGY_H */ diff --git a/include/aws/io/shared_library.h b/include/aws/io/shared_library.h index 323afed60..c00eb98af 100644 --- a/include/aws/io/shared_library.h +++ b/include/aws/io/shared_library.h @@ -8,6 +8,8 @@ #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_byte_cursor; /* @@ -44,5 +46,6 @@ int aws_shared_library_find_function( aws_generic_function *function_address); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_COMMON_SHARED_LIBRARY_H */ diff --git a/include/aws/io/socket.h b/include/aws/io/socket.h index b4f320080..9ef8913a9 100644 --- a/include/aws/io/socket.h +++ b/include/aws/io/socket.h @@ -8,6 +8,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + enum aws_socket_domain { AWS_SOCKET_IPV4, AWS_SOCKET_IPV6, @@ -301,5 +303,6 @@ AWS_IO_API int aws_socket_get_error(struct aws_socket *socket); AWS_IO_API bool aws_socket_is_open(struct aws_socket *socket); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_SOCKET_H */ diff --git a/include/aws/io/socket_channel_handler.h b/include/aws/io/socket_channel_handler.h index e837b0784..a9f6a23cb 100644 --- a/include/aws/io/socket_channel_handler.h +++ b/include/aws/io/socket_channel_handler.h @@ -7,6 +7,8 @@ #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_socket; struct aws_channel_handler; struct aws_channel_slot; @@ -28,5 +30,6 @@ AWS_IO_API struct aws_channel_handler *aws_socket_handler_new( AWS_IO_API const struct aws_socket *aws_socket_handler_get_socket(const struct aws_channel_handler *handler); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_SOCKET_CHANNEL_HANDLER_H */ diff --git a/include/aws/io/statistics.h b/include/aws/io/statistics.h index ce63a7ca3..62217e176 100644 --- a/include/aws/io/statistics.h +++ b/include/aws/io/statistics.h @@ -11,6 +11,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + enum aws_crt_io_statistics_category { AWSCRT_STAT_CAT_SOCKET = AWS_CRT_STATISTICS_CATEGORY_BEGIN_RANGE(AWS_C_IO_PACKAGE_ID), AWSCRT_STAT_CAT_TLS, @@ -74,5 +76,6 @@ AWS_IO_API void aws_crt_statistics_tls_reset(struct aws_crt_statistics_tls *stats); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_STATISTICS_H */ diff --git a/include/aws/io/stream.h b/include/aws/io/stream.h index ff86de970..711537d02 100644 --- a/include/aws/io/stream.h +++ b/include/aws/io/stream.h @@ -9,6 +9,8 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + struct aws_input_stream; struct aws_byte_buf; @@ -129,5 +131,6 @@ AWS_IO_API struct aws_input_stream *aws_input_stream_new_from_file( AWS_IO_API struct aws_input_stream *aws_input_stream_new_from_open_file(struct aws_allocator *allocator, FILE *file); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_STREAM_H */ diff --git a/include/aws/io/tls_channel_handler.h b/include/aws/io/tls_channel_handler.h index bb0eed7d3..5c630de83 100644 --- a/include/aws/io/tls_channel_handler.h +++ b/include/aws/io/tls_channel_handler.h @@ -8,6 +8,10 @@ #include #include +AWS_PUSH_SANE_WARNING_LEVEL + +#define AWS_TLS_NEGOTIATED_PROTOCOL_MESSAGE 0x01 + struct aws_channel_slot; struct aws_channel_handler; struct aws_pkcs11_session; @@ -254,8 +258,6 @@ struct aws_tls_negotiated_protocol_message { struct aws_byte_buf protocol; }; -static const int AWS_TLS_NEGOTIATED_PROTOCOL_MESSAGE = 0x01; - typedef struct aws_channel_handler *( *aws_tls_on_protocol_negotiated)(struct aws_channel_slot *new_slot, struct aws_byte_buf *protocol, void *user_data); @@ -914,5 +916,6 @@ AWS_IO_API const char *aws_tls_key_operation_type_str(enum aws_tls_key_operation_type operation_type); AWS_EXTERN_C_END +AWS_POP_SANE_WARNING_LEVEL #endif /* AWS_IO_TLS_CHANNEL_HANDLER_H */