qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] subprojects/berkeley-testfloat-3: Update to fix a problem wi


From: Thomas Huth
Subject: Re: [PATCH] subprojects/berkeley-testfloat-3: Update to fix a problem with compiler warnings
Date: Thu, 17 Aug 2023 13:31:44 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]