mirror of
https://github.com/obgm/libcoap.git
synced 2026-12-03 03:01:05 +03:00
block: compile full_match() only when client support is enabled
With `-DENABLE_CLIENT_MODE=OFF` (i.e. `COAP_CLIENT_SUPPORT=0`), `full_match()` in `src/coap_block.c` is defined but its only caller is compiled out, producing `-Wunused-function` (fatal in -Werror builds): ``` src/coap_block.c:479:1: error: unused function 'full_match' [-Werror=-Wunused-function] ``` Wrap the static-inline definition in the same `#if COAP_CLIENT_SUPPORT` guard as its caller. Signed-off-by: warter666 <121139223+Warterkk@users.noreply.github.com>
This commit is contained in:
1 parent
899a9e533a
commit
6cb2addb1e
1 file changed
+2
@@ -475,11 +475,13 @@ coap_context_set_max_block_size_lkd(coap_context_t *context, size_t max_block_si
|
||||
return 1;
|
||||
}
|
||||
|
||||
#if COAP_CLIENT_SUPPORT
|
||||
COAP_STATIC_INLINE int
|
||||
full_match(const uint8_t *a, size_t alen,
|
||||
const uint8_t *b, size_t blen) {
|
||||
return alen == blen && (alen == 0 || memcmp(a, b, alen) == 0);
|
||||
}
|
||||
#endif /* COAP_CLIENT_SUPPORT */
|
||||
|
||||
coap_lg_xmit_t *
|
||||
coap_find_lg_xmit(coap_session_t *session, coap_pdu_t *pdu) {
|
||||
|
||||
Reference in new issue
Block a user