eosnetworkfoundation / ledger-app

EOS app for ledger devices
Apache License 2.0
1 stars 0 forks source link

Unused bagl_element_t Parameter main.c #17

Closed ericpassmore closed 2 years ago

ericpassmore commented 2 years ago

src/main.c:500:61: warning: unused parameter 'e' [-Wunused-parameter] unsigned int io_seproxyhal_touch_exit(const bagl_element_t e) ^ src/main.c:507:67: warning: unused parameter 'e' [-Wunused-parameter] unsigned int io_seproxyhal_touch_address_ok(const bagl_element_t e) ^ src/main.c:516:71: warning: unused parameter 'e' [-Wunused-parameter] unsigned int io_seproxyhal_touch_address_cancel(const bagl_element_t e) ^ src/main.c:524:62: warning: unused parameter 'e' [-Wunused-parameter] unsigned int io_seproxyhal_touch_tx_ok(const bagl_element_t e) ^ src/main.c:534:66: warning: unused parameter 'e' [-Wunused-parameter] unsigned int io_seproxyhal_touch_tx_cancel(const bagl_element_t *e)

ericpassmore commented 2 years ago

Many functions defined in main.c all with the same parameter type all unused. Is there another caller passing in the parameter? Doesn't seem safe to remove. Need to look at better coding patterns for this.

https://github.com/eosnetworkfoundation/ledger-app/blob/d2aa9efd31f7dfe54d778223f703a0c2d9fbe689/src/main.c#L31-L35

https://github.com/eosnetworkfoundation/ledger-app/blob/d2aa9efd31f7dfe54d778223f703a0c2d9fbe689/src/main.c#L500-L547

https://github.com/eosnetworkfoundation/ledger-app/blob/d2aa9efd31f7dfe54d778223f703a0c2d9fbe689/src/main.c#L962-L966

ericpassmore commented 2 years ago

updating parameter to __attribute__((unused)) const bagl_element_t *e

ericpassmore commented 2 years ago

Need calling pattern to support external events, parameter value not needed for our simple logic. Other blockchains do the same.