This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Don't divide by zero when trying to destroy an uninitialised barrier.
- From: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 26 Apr 2016 11:44:32 -0300
- Subject: Re: [PATCH] Don't divide by zero when trying to destroy an uninitialised barrier.
- Authentication-results: sourceware.org; auth=none
- References: <5717B2F4 dot 9050105 at starleaf dot com> <5717B657 dot 6040007 at arm dot com> <5717D575 dot 40806 at starleaf dot com> <5717DCA6 dot 1090809 at linaro dot org> <571F7D5F dot 2080603 at redhat dot com>
On 26/04/2016 11:38, Florian Weimer wrote:
> On 04/20/2016 09:46 PM, Adhemerval Zanella wrote:
>> I do not see a compelling reason to not return EINVAL if the UB
>> could be detected and if POSIX stated this behaviour is recommended.
>
> It would result in silent loss of synchronization if the return value is not checked. Such bugs are difficult to track down.
>
> Florian
But the check is user responsibility and getting such error means the
program is doing something fuzzy.
But thinking twice seems that abort in such cases seems a better
alternative, it gives the user a more straightforward indication
he should check his code.