We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eb0a10a + 9d55719 commit cfa2899Copy full SHA for cfa2899
cores/arduino/SafeRingBuffer.h
@@ -41,6 +41,12 @@ int SafeRingBufferN<N>::read_char() {
41
synchronized {
42
return RingBufferN<N>::read_char();
43
}
44
+
45
+ // We should never reached this line because the synchronized {} block gets
46
+ // executed at least once. However the compiler gets confused and prints a
47
+ // warning about control reaching the end of a non-void function. This
48
+ // silences that warning.
49
+ return -1;
50
51
52
template <int N>
@@ -53,4 +59,4 @@ void SafeRingBufferN<N>::store_char(uint8_t c) {
53
59
54
60
55
61
#endif /* _SAFE_RING_BUFFER_ */
56
-#endif /* __cplusplus */
62
+#endif /* __cplusplus */
0 commit comments