bug-gnulib
[Top][All Lists]
Advanced

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

Re: test-math.c:89:3: runtime error: division by zero


From: Jeffrey Walton
Subject: Re: test-math.c:89:3: runtime error: division by zero
Date: Sun, 29 Mar 2020 17:09:44 -0400

On Sun, Mar 29, 2020 at 12:24 PM Bruno Haible <address@hidden> wrote:
>
> Jeffrey Walton wrote:
> > This showed up during acosf testing with UBsan:
> >
> > test-math.c:89:3: runtime error: division by zero
>
> The code performs a division 1.0 / 0.0. This is a valid operation in
> IEEE 854. It must produce a HUGE_VAL.
>
> Surely you can tell the sanitizer to ignore this?

Well, my first reaction is, that sucks. I don't recall a situation
where undefined behavior was conforming like that.

Let's see what the GCC folks recommend: "GCC and division by 0 under
sanitizers", https://gcc.gnu.org/pipermail/gcc-help/2020-March/138746.html.

I tend to do what the GCC devs say. They write the compilers that
remove the code with undefined behavior and produce unexpected
results. It is wise to keep the compiler happy.

Jeff



reply via email to

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