Memotech-Bill / bluetooth-stdio

STDIO over Bluetooth for Pico_W C SDK
Other
5 stars 0 forks source link

Compiler warnings #2

Open tjko opened 9 months ago

tjko commented 9 months ago

FYI, compiling with -Wall seems to produce following warnings:

libs/bluetooth-stdio/stdio_bt.c: In function 'packet_handler':
libs/bluetooth-stdio/stdio_bt.c:199:9: warning: unused variable 'i' [-Wunused-variable]
  199 |     int i;
      |         ^
libs/bluetooth-stdio/stdio_bt.c:198:15: warning: variable 'mtu' set but not used [-Wunused-but-set-variable]
  198 |     uint16_t  mtu;
      |               ^~~
libs/bluetooth-stdio/stdio_bt.c:197:15: warning: variable 'rfcomm_channel_nr' set but not used [-Wunused-but-set-variable]
  197 |     uint8_t   rfcomm_channel_nr;
      |               ^~~~~~~~~~~~~~~~~
Memotech-Bill commented 9 months ago

Those variables were used for diagnostics which have either been commented out or removed.

I have now similarly commented out or removed the variable definitions.

tjko commented 9 months ago

Compile fails now, looks like these should be commented out as well (?):

libs/bluetooth-stdio/stdio_bt.c:220:21: error: 'rfcomm_channel_nr' undeclared (first use in this function); did you mean 'rfcomm_channel_id'?
  220 |                     rfcomm_channel_nr = rfcomm_event_incoming_connection_get_server_channel(packet);
      |                     ^~~~~~~~~~~~~~~~~
      |                     rfcomm_channel_id
libs/bluetooth-stdio/stdio_bt.c:220:21: note: each undeclared identifier is reported only once for each function it appears in
libs/bluetooth-stdio/stdio_bt.c:234:25: error: 'mtu' undeclared (first use in this function)
  234 |                         mtu = rfcomm_event_channel_opened_get_max_frame_size(packet);
      |                         ^~~