diff --git a/CHANGELOG.md b/CHANGELOG.md index 982c0df5..d31632b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## unreleased +### Fixed + + - Mark the following functions with `__attribute__((warn_unused_result))` (when available): + - `SmolRTSP_ParseError_print`. + - `SmolRTSP_MessageBody_empty`. + - `SmolRTSP_Request_uninit`. + - `SmolRTSP_Response_uninit`. + - `SmolRTSP_NalTransportConfig_default`. + - `smolrtsp_determine_start_code`. + - `smolrtsp_dgram_socket`. + ## 0.1.0 - 2022-03-30 ### Added diff --git a/include/smolrtsp/nal.h b/include/smolrtsp/nal.h index 98f8e1c7..9bd0007b 100644 --- a/include/smolrtsp/nal.h +++ b/include/smolrtsp/nal.h @@ -153,7 +153,8 @@ typedef size_t (*SmolRTSP_NalStartCodeTester)(U8Slice99 data); * file to #smolrtsp_determine_start_code and invoke the returned tester * multiple times afterwards. */ -SmolRTSP_NalStartCodeTester smolrtsp_determine_start_code(U8Slice99 data); +SmolRTSP_NalStartCodeTester +smolrtsp_determine_start_code(U8Slice99 data) SMOLRTSP_PRIV_MUST_USE; /** * The 3-byte start code tester (`0x000001`). diff --git a/include/smolrtsp/nal_transport.h b/include/smolrtsp/nal_transport.h index 97456f99..380e030c 100644 --- a/include/smolrtsp/nal_transport.h +++ b/include/smolrtsp/nal_transport.h @@ -52,7 +52,8 @@ typedef struct { * - `max_h264_nalu_size` is #SMOLRTSP_MAX_H264_NALU_SIZE. * - `max_h265_nalu_size` is #SMOLRTSP_MAX_H265_NALU_SIZE. */ -SmolRTSP_NalTransportConfig SmolRTSP_NalTransportConfig_default(void); +SmolRTSP_NalTransportConfig +SmolRTSP_NalTransportConfig_default(void) SMOLRTSP_PRIV_MUST_USE; /** * An RTP/NAL data transport. diff --git a/include/smolrtsp/transport.h b/include/smolrtsp/transport.h index 807559c5..5a20da9e 100644 --- a/include/smolrtsp/transport.h +++ b/include/smolrtsp/transport.h @@ -84,7 +84,8 @@ SmolRTSP_Transport smolrtsp_transport_udp(int fd) SMOLRTSP_PRIV_MUST_USE; * @return A valid file descriptor or -1 on error (and sets `errno` * appropriately). */ -int smolrtsp_dgram_socket(int af, const void *restrict addr, uint16_t port); +int smolrtsp_dgram_socket(int af, const void *restrict addr, uint16_t port) + SMOLRTSP_PRIV_MUST_USE; /** * Returns a pointer to the IP address of @p addr. diff --git a/include/smolrtsp/types/error.h b/include/smolrtsp/types/error.h index b0f54924..ebab74cd 100644 --- a/include/smolrtsp/types/error.h +++ b/include/smolrtsp/types/error.h @@ -84,7 +84,8 @@ datatype99( * * @pre `w.self && w.vptr` */ -int SmolRTSP_ParseError_print(SmolRTSP_ParseError self, SmolRTSP_Writer w); +int SmolRTSP_ParseError_print(SmolRTSP_ParseError self, SmolRTSP_Writer w) + SMOLRTSP_PRIV_MUST_USE; /** * A status of successful parsing. diff --git a/include/smolrtsp/types/message_body.h b/include/smolrtsp/types/message_body.h index 33e756bd..a34fbba3 100644 --- a/include/smolrtsp/types/message_body.h +++ b/include/smolrtsp/types/message_body.h @@ -30,7 +30,7 @@ SmolRTSP_ParseResult SmolRTSP_MessageBody_parse( /** * Returns an empty message body. */ -SmolRTSP_MessageBody SmolRTSP_MessageBody_empty(void); +SmolRTSP_MessageBody SmolRTSP_MessageBody_empty(void) SMOLRTSP_PRIV_MUST_USE; /** * Tests @p lhs and @p rhs for equality. diff --git a/include/smolrtsp/types/request.h b/include/smolrtsp/types/request.h index 8a0ac141..133533da 100644 --- a/include/smolrtsp/types/request.h +++ b/include/smolrtsp/types/request.h @@ -43,7 +43,7 @@ typedef struct { /** * Returns an RTSP request suitable for being parsed. */ -SmolRTSP_Request SmolRTSP_Request_uninit(void); +SmolRTSP_Request SmolRTSP_Request_uninit(void) SMOLRTSP_PRIV_MUST_USE; /** * Serialises @p self into @p w. diff --git a/include/smolrtsp/types/response.h b/include/smolrtsp/types/response.h index e867e140..d23f0ac6 100644 --- a/include/smolrtsp/types/response.h +++ b/include/smolrtsp/types/response.h @@ -43,7 +43,7 @@ typedef struct { /** * Returns an RTSP response suitable for being parsed. */ -SmolRTSP_Response SmolRTSP_Response_uninit(void); +SmolRTSP_Response SmolRTSP_Response_uninit(void) SMOLRTSP_PRIV_MUST_USE; /** * Serialises @p self into @p w.