[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 02/19] host-utils: move abs64() to host-utils
From: |
Luis Fernando Fujita Pires |
Subject: |
RE: [PATCH 02/19] host-utils: move abs64() to host-utils |
Date: |
Fri, 27 Aug 2021 14:28:27 +0000 |
> >> Oh, I wasn't referring to any specific users. What I meant is that,
> >> if we make abs64() generically available from host-utils, callers
> >> could expect it to behave the same way as abs() in stdlib, for
> >> example.
> >
> > That would be surprising, but do you think there are cases where that
> > would be a bad surprise?
> >
> > I don't think anybody who is aware of the abs(INT_MIN),
> > labs(LONG_MIN), and llabs(LLONG_MIN) edge cases actually _like_ that
> > behaviour.
> >
> > If you really want to avoid surprises, providing a saner function with
> > a different name seems better than trying to emulate the edge cases of
> > abs()/labs()/llabs().
>
> Agreed. See do_strtosz() for example.
I'll make this change when I submit the next version of this patch series.
Thanks!
--
Luis Pires
Instituto de Pesquisas ELDORADO
Aviso Legal - Disclaimer <https://www.eldorado.org.br/disclaimer.html>
- [PATCH 00/19] target/ppc: DFP instructions using decodetree, Luis Pires, 2021/08/24
- [PATCH 01/19] host-utils: Fix overflow detection in divu128(), Luis Pires, 2021/08/24
- [PATCH 02/19] host-utils: move abs64() to host-utils, Luis Pires, 2021/08/24
- Re: [PATCH 02/19] host-utils: move abs64() to host-utils, David Gibson, 2021/08/25
- RE: [PATCH 02/19] host-utils: move abs64() to host-utils, Luis Fernando Fujita Pires, 2021/08/25
- Re: [PATCH 02/19] host-utils: move abs64() to host-utils, Eduardo Habkost, 2021/08/25
- RE: [PATCH 02/19] host-utils: move abs64() to host-utils, Luis Fernando Fujita Pires, 2021/08/25
- Re: [PATCH 02/19] host-utils: move abs64() to host-utils, Eduardo Habkost, 2021/08/25
- Re: [PATCH 02/19] host-utils: move abs64() to host-utils, Philippe Mathieu-Daudé, 2021/08/25
- RE: [PATCH 02/19] host-utils: move abs64() to host-utils,
Luis Fernando Fujita Pires <=
[PATCH 03/19] host-utils: move checks out of divu128/divs128, Luis Pires, 2021/08/24
[PATCH 04/19] host-utils: add 128-bit quotient support to divu128/divs128, Luis Pires, 2021/08/24
[PATCH 05/19] host-utils: add unit tests for divu128/divs128, Luis Pires, 2021/08/24
[PATCH 06/19] libdecnumber: introduce decNumberFrom[U]Int128, Luis Pires, 2021/08/24
[PATCH 07/19] target/ppc: Move REQUIRE_ALTIVEC/VECTOR to translate.c, Luis Pires, 2021/08/24
[PATCH 08/19] target/ppc: Introduce REQUIRE_FPU, Luis Pires, 2021/08/24
[PATCH 09/19] target/ppc: Implement DCFFIXQQ, Luis Pires, 2021/08/24
[PATCH 10/19] host-utils: Introduce mulu128, Luis Pires, 2021/08/24