On 16/08/2023 14.49, Philippe Mathieu-Daudé wrote:
On 16/8/23 11:15, Thomas Huth wrote:
Update the berkeley-testfloat-3 wrap to include a patch provided by
Olaf Hering. This fixes a problem with "control reaches end of non-void
function [-Werror=return-type]" compiler warning/errors that are now
enabled by default in certain versions of GCC.
e7af9751d9 has:
--- a/source/genCases_f32.c
+++ b/source/genCases_f32.c
@@ -411,6 +411,7 @@ static float32_t f32Random( void )
case 6:
return f32RandomQInfP3();
case 7:
+ default:
return f32RandomQInfPInf();
}
Why the default is with 7 and not 3 or 5?
Shouldn't we abort() or mark with __builtin_unreachable()?
If you look at the code, it's really impossible to get any other values
here, so an abort() or something similar would not really help to discover
additional bugs (except buggy compilers maybe). So I personally don't care
too much, but if it bugs you, feel free to send another patch on top of it.
Thomas