This is the mail archive of the
mailing list for the glibc project.
Re: Ignoring failures and altering behavior
- From: Paul Eggert <eggert at cs dot ucla dot edu>
- To: Florian Weimer <fweimer at redhat dot com>, libc-alpha at sourceware dot org
- Date: Wed, 17 Oct 2018 11:24:49 -0700
- Subject: Re: Ignoring failures and altering behavior
- References: <firstname.lastname@example.org>
On 10/17/18 3:36 AM, Florian Weimer wrote:
Should we keep running at
all cost, possibly giving quite different results, or is it better to
actually report the errors we encounter and stop?
Here's an example I'm familiar with. When localtime runs out of memory,
it could return NULL with errno == ENOMEM; but in practice glibc
localtime, like that of many (most?) C libraries, defaults to UTC and
keeps going even though the resulting values are incorrect. If glibc
localtime switched to returning NULL in this situation, I imagine a lot
of (unportable and incorrect) user code will stop working when memory
gets low; on the other hand, some portable and correct user code will
start working better. Should we change localtime's behavior?