Skip to content

Commit 65ba15c

Browse files
author
Ben Avison
committed
Remove unreachable code
IAR generates warning Pe111 'statement is unreachable'. In a couple of cases, replace return statements with TU_ATTR_FALLTHROUGH; because some compilers apparently can't figure out that the return statements are unreachable but do whinge about an imagined fall-through without them!
1 parent 16518dc commit 65ba15c

File tree

23 files changed

+5
-54
lines changed

23 files changed

+5
-54
lines changed

examples/device/audio_4_channel_mic/src/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ int main(void)
9999
led_blinking_task();
100100
audio_task();
101101
}
102-
103-
104-
return 0;
105102
}
106103

107104
//--------------------------------------------------------------------+

examples/device/audio_test/src/main.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ int main(void)
100100
led_blinking_task();
101101
audio_task();
102102
}
103-
104-
105-
return 0;
106103
}
107104

108105
//--------------------------------------------------------------------+

examples/device/board_test/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ int main(void)
6767
led_state = 1 - led_state; // toggle
6868
}
6969
}
70-
71-
return 0;
7270
}
7371

7472
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2 || CFG_TUSB_MCU == OPT_MCU_ESP32S3

examples/device/cdc_dual_ports/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ int main(void)
4747
tud_task(); // tinyusb device task
4848
cdc_task();
4949
}
50-
51-
return 0;
5250
}
5351

5452
// echo to either Serial0 or Serial1

examples/device/cdc_msc/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ int main(void)
6565

6666
cdc_task();
6767
}
68-
69-
return 0;
7068
}
7169

7270
//--------------------------------------------------------------------+

examples/device/dfu/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ int main(void)
8282
tud_task(); // tinyusb device task
8383
led_blinking_task();
8484
}
85-
86-
return 0;
8785
}
8886

8987
//--------------------------------------------------------------------+

examples/device/dfu_runtime/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ int main(void)
7777
tud_task(); // tinyusb device task
7878
led_blinking_task();
7979
}
80-
81-
return 0;
8280
}
8381

8482
//--------------------------------------------------------------------+

examples/device/dynamic_configuration/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ int main(void)
6666
cdc_task();
6767
midi_task();
6868
}
69-
70-
return 0;
7169
}
7270

7371
//--------------------------------------------------------------------+

examples/device/hid_composite/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ int main(void)
6767

6868
hid_task();
6969
}
70-
71-
return 0;
7270
}
7371

7472
//--------------------------------------------------------------------+

examples/device/hid_generic_inout/src/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ int main(void)
8888
tud_task(); // tinyusb device task
8989
led_blinking_task();
9090
}
91-
92-
return 0;
9391
}
9492

9593
//--------------------------------------------------------------------+

0 commit comments

Comments
 (0)