diff --git a/src/protocol/codec/ext.c b/src/protocol/codec/ext.c index 8d99054b5..6ca7ecaee 100644 --- a/src/protocol/codec/ext.c +++ b/src/protocol/codec/ext.c @@ -167,8 +167,8 @@ int8_t _z_msg_ext_vec_decode(_z_msg_ext_vec_t *extensions, _z_zbuf_t *zbf) { } int8_t _z_msg_ext_unknown_error(_z_msg_ext_t *extension, uint8_t trace_id) { - uint8_t ext_id = _Z_EXT_ID(extension->_header); #if (ZENOH_DEBUG >= 1) + uint8_t ext_id = _Z_EXT_ID(extension->_header); switch (_Z_EXT_ENC(extension->_header)) { case _Z_MSG_EXT_ENC_UNIT: { _Z_ERROR("Unknown mandatory extension found (extension_id: %02x, trace_id: %02x), UNIT", ext_id, trace_id); @@ -195,6 +195,9 @@ int8_t _z_msg_ext_unknown_error(_z_msg_ext_t *extension, uint8_t trace_id) { trace_id); } } +#else + _ZP_UNUSED(extension); + _ZP_UNUSED(trace_id); #endif return _Z_ERR_MESSAGE_EXTENSION_MANDATORY_AND_UNKNOWN; } diff --git a/src/session/reply.c b/src/session/reply.c index 7fcffc0e3..15cf19407 100644 --- a/src/session/reply.c +++ b/src/session/reply.c @@ -34,11 +34,12 @@ int8_t _z_trigger_reply_partial(_z_session_t *zn, _z_zint_t id, _z_keyexpr_t key int8_t _z_trigger_reply_final(_z_session_t *zn, _z_n_msg_response_final_t *final) { int8_t ret = _Z_RES_OK; +#if Z_FEATURE_QUERY == 1 // TODO check id to know where to dispatch _z_zint_t id = final->_request_id; - -#if Z_FEATURE_QUERY == 1 _z_trigger_query_reply_final(zn, id); +#else + _ZP_UNUSED(final); #endif return ret; } diff --git a/src/session/rx.c b/src/session/rx.c index 5ba2bc6ed..0428aef12 100644 --- a/src/session/rx.c +++ b/src/session/rx.c @@ -153,6 +153,7 @@ int8_t _z_handle_network_message(_z_session_t *zn, _z_zenoh_message_t *msg, uint // @TODO: expose errors to the user _z_msg_err_t error = response._body._err; _z_bytes_t payload = error._ext_value.payload; + _ZP_UNUSED(payload); // Unused when logs are deactivated _Z_ERROR("Received Err for query %zu: code=%d, message=%.*s", response._request_id, error._code, (int)payload.len, payload.start); } break; diff --git a/src/transport/unicast/transport.c b/src/transport/unicast/transport.c index 2c321f7a7..11e7467e6 100644 --- a/src/transport/unicast/transport.c +++ b/src/transport/unicast/transport.c @@ -122,7 +122,10 @@ int8_t _z_unicast_transport_create(_z_transport_t *zt, _z_link_t *zl, _z_transpo _z_wbuf_clear(&zt->_transport._unicast._wbuf); _z_zbuf_clear(&zt->_transport._unicast._zbuf); } -#endif +#else + _ZP_UNUSED(dbuf_size); + _ZP_UNUSED(expandable); +#endif // Z_FEATURE_FRAGMENTATION == 1 } if (ret == _Z_RES_OK) {