This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix make check build warnings in libm


On Sun, Feb 17, 2013 at 10:42 PM, Siddhesh Poyarekar
<siddhesh@redhat.com> wrote:
> On Fri, Feb 15, 2013 at 09:44:34PM -0500, Carlos O'Donell wrote:
>>
>> What about this commented out line?
>>
>> Why are we using chk if all the assert's on chk are commented out?
>>
>> >           chk |= (n ? mpn_sub_n : mpn_add_n)(d,ss,tmp,SZ);                    \
>> >          /* assert(chk == 0); */                                              \
>>
>
> I'm not sure why, but most mpn functions seem to return carry or
> borrow if any or just zero.  It's been that way since inclusion
> (1997), so it might make sense to just remove them.  I don't think any
> of the inputs will cause an overflow and the checks were probably
> there earlier for debugging.

Right, but this function doesn't return anything :-)

Debugging checks should be actively compiled into the code and
removed by the compiler when a conditional statement is easily
provably to be false.

This is what GCC does to avoid bitrot in the debugging and testing
code, and it's one thing I've seen the community mention was great
at keeping this code updated.

I'd like to see this file 100% fixed, not 50% fixed.

Can you look at removing chk? We can always go back to an old
version later with source control, but right now it's not useful to have
code for chk that does nothing.

Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]