diff --git a/cores/arduino/SafeRingBuffer.h b/cores/arduino/SafeRingBuffer.h index 7526ae54a..235406fac 100644 --- a/cores/arduino/SafeRingBuffer.h +++ b/cores/arduino/SafeRingBuffer.h @@ -41,6 +41,12 @@ int SafeRingBufferN::read_char() { synchronized { return RingBufferN::read_char(); } + + // We should never reached this line because the synchronized {} block gets + // executed at least once. However the compiler gets confused and prints a + // warning about control reaching the end of a non-void function. This + // silences that warning. + return -1; } template @@ -53,4 +59,4 @@ void SafeRingBufferN::store_char(uint8_t c) { } #endif /* _SAFE_RING_BUFFER_ */ -#endif /* __cplusplus */ \ No newline at end of file +#endif /* __cplusplus */