Skip to content

Commit 2eedc2e

Browse files
committed
Use [[maybe_unused]] instead of #pragma
1 parent 04e0f75 commit 2eedc2e

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

libraries/Zigbee/src/ZigbeeEP.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ char* ZigbeeEP::readModel(uint8_t endpoint, uint16_t short_addr) {
126126

127127
void ZigbeeEP::printBoundDevices() {
128128
log_i("Bound devices:");
129-
for(const auto& device : _bound_devices) {
129+
for( [[maybe_unused]] const auto& device : _bound_devices) {
130130
log_i("Device on endpoint %d, short address: 0x%x", device->endpoint, device->short_addr);
131131
print_ieee_addr(device->ieee_addr);
132132
}

libraries/Zigbee/src/ZigbeeHandlers.cpp

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,8 @@ static esp_err_t zb_cmd_read_attr_resp_handler(const esp_zb_zcl_cmd_read_attr_re
1111
static esp_err_t zb_configure_report_resp_handler(const esp_zb_zcl_cmd_config_report_resp_message_t *message);
1212
static esp_err_t zb_cmd_default_resp_handler(const esp_zb_zcl_cmd_default_resp_message_t *message);
1313

14-
15-
#pragma GCC diagnostic push
16-
#pragma GCC diagnostic ignored "-Wunused-function"
17-
1814
// Zigbee action handlers
19-
static esp_err_t zb_action_handler(esp_zb_core_action_callback_id_t callback_id, const void *message) {
15+
[[maybe_unused]] static esp_err_t zb_action_handler(esp_zb_core_action_callback_id_t callback_id, const void *message) {
2016
esp_err_t ret = ESP_OK;
2117
switch (callback_id) {
2218
case ESP_ZB_CORE_SET_ATTR_VALUE_CB_ID: ret = zb_attribute_set_handler((esp_zb_zcl_set_attr_value_message_t *)message); break;
@@ -29,8 +25,6 @@ static esp_err_t zb_action_handler(esp_zb_core_action_callback_id_t callback_id,
2925
return ret;
3026
}
3127

32-
#pragma GCC diagnostic pop
33-
3428
static esp_err_t zb_attribute_set_handler(const esp_zb_zcl_set_attr_value_message_t *message) {
3529
if (!message) {
3630
log_e("Empty message");

0 commit comments

Comments
 (0)