Re: testing for signed char / short / int addition overflow

2021-03-14 Thread Paul Eggert
On 3/14/21 7:59 PM, Bruno Haible wrote: The functions my_signed1_overflow, my_signed2_overflow in the attached file produce better machine code than the corresponding functions signed1_overflow, signed2_overflow that use intprops.h primitives. That wasn't true on my platform (Ubuntu 20.10 x86-6

testing for signed char / short / int addition overflow

2021-03-14 Thread Bruno Haible
Hi Paul, When one needs a fast test whether an addition of two 'signed char' or 'short' overflows, the macros in intprops.h yield a valid answer, but it is not so well optimized. The functions my_signed1_overflow, my_signed2_overflow in the attached file produce better machine code than the corres

remark about INT_ADD_OVERFLOW

2021-03-14 Thread Bruno Haible
It might be worth mentioning in the comments in intprops.h that for short a, b; INT_ADD_OVERFLOW (a, b) tests whether the C expression (a + b) overflows; it does *not* test whether the assignment short sum = a + b; overflows. Bruno

Re: tzalloc

2021-03-14 Thread Bruno Haible
Paul Eggert wrote: > My plan has been to add them eventually to glibc, where they would be > multithread-safe. That would be nice, indeed! Use cases that I can see: - A server process that talks to several users in different locales and time zones. (We have locale_t for several years a

Re: tzalloc (was: Re: parse-datetime test failure on NetBSD)

2021-03-14 Thread Paul Eggert
On 3/14/21 11:33 AM, Bruno Haible wrote: A close term is "multithread-safe". The API could be implemented in a multithread-safe way, but time_rz.c is not multithread-safe, due to the function 'change_env'. It is planned to provide a multithread-safe implementation at some point? My plan has be

Re: tzalloc (was: Re: parse-datetime test failure on NetBSD)

2021-03-14 Thread Bruno Haible
Paul Eggert wrote: > > On NetBSD, tzalloc() is in libc, and tzalloc("\\") returns NULL. > > On other platforms, tzalloc() comes from Gnulib, and tzalloc("\\") returns > > non-NULL. > > > > Which behaviour is correct? > > Both. The set of supported TZ values is system-dependent. OK, then we need

Re: tzalloc (was: Re: parse-datetime test failure on NetBSD)

2021-03-14 Thread Paul Eggert
On 3/14/21 4:53 AM, Bruno Haible wrote: On NetBSD, tzalloc() is in libc, and tzalloc("\\") returns NULL. On other platforms, tzalloc() comes from Gnulib, and tzalloc("\\") returns non-NULL. Which behaviour is correct? Both. The set of supported TZ values is system-dependent.

tzalloc (was: Re: parse-datetime test failure on NetBSD)

2021-03-14 Thread Bruno Haible
> FAIL: test-parse-datetime > = > > test-parse-datetime.c:434: assertion 'parse_datetime (&result, "TZ=\"\"", > &now)' failed > FAIL test-parse-datetime (exit status: 134) The problem comes from the tzalloc function. On NetBSD, tzalloc() is in libc, and tzalloc("\\")

Re: parse-datetime test failure on NetBSD

2021-03-14 Thread Thomas Klausner
On Sun, Mar 14, 2021 at 11:42:43AM +0100, Bruno Haible wrote: > Hi Thomas, > > > The recipe from that bug report fails for me on NetBSD 9.99.81/amd64 > > with gcc 9.3.0: > > With version of Bison are you using? 3.7.5 Thomas

Re: parse-datetime test failure on NetBSD

2021-03-14 Thread Bruno Haible
Hi Thomas, > The recipe from that bug report fails for me on NetBSD 9.99.81/amd64 > with gcc 9.3.0: With version of Bison are you using? Bruno

parse-datetime test failure on NetBSD

2021-03-14 Thread Thomas Klausner
Hi! I reported a bug in gnutls 3.7.1 https://gitlab.com/gnutls/gnutls/-/issues/1190#note_528802421 and was told it might be a bug in gnulib instead. The recipe from that bug report fails for me on NetBSD 9.99.81/amd64 with gcc 9.3.0: git clone --depth=1 https://git.sv.gnu.org/git/gnulib.git cd