espressif / esp-nimble

A fork of NimBLE stack, for use with ESP32 and ESP-IDF
Apache License 2.0
76 stars 49 forks source link

Fix gcc 13 warnings #57

Closed Lapshin closed 10 months ago

Lapshin commented 11 months ago

This change fixes warnings that appeared when compiling with GCC 13.1.0:

/home/alex/git/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_att_svr.c:1838:16: error: 'entry' may be used uninitialized [-Werror=maybe-uninitialized]
 1838 |             if (entry == NULL) {
      |                ^
/home/alex/git/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_att_svr.c:1713:31: note: 'entry' was declared here
 1713 |     struct ble_att_svr_entry *entry;
      |                               ^~~~~
/home/alex/git/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_att_svr.c:1846:18: error: 'start_group_handle' may be used uninitialized [-Werror=maybe-uninitialized]
 1846 |             rc = ble_att_svr_read_group_type_entry_write(txom, mtu,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1847 |                                                          start_group_handle,
      |                                                          ~~~~~~~~~~~~~~~~~~~
 1848 |                                                          end_group_handle,
      |                                                          ~~~~~~~~~~~~~~~~~
 1849 |                                                          &service_uuid.u);
      |                                                          ~~~~~~~~~~~~~~~~
/home/alex/git/esp-idf/components/bt/host/nimble/nimble/nimble/host/src/ble_att_svr.c:1715:14: note: 'start_group_handle' was declared here
 1715 |     uint16_t start_group_handle;
      |              ^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
CLAassistant commented 11 months ago

CLA assistant check
All committers have signed the CLA.

rahult-github commented 11 months ago

Hi @Lapshin ,

Thanks. esp-nimble is clone of upstream apache mynewt nimble. May i request you to raise this even on upstream repo ? It would be easy for migration purpose .

Lapshin commented 11 months ago

@rahult-github , created https://github.com/apache/mynewt-nimble/pull/1554

rahult-github commented 10 months ago

Change has been merged. Closing.