bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: enable -Werror for lib/ in coreutils


From: Paolo Bonzini
Subject: Re: enable -Werror for lib/ in coreutils
Date: Thu, 29 Oct 2009 10:08:05 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.4pre) Gecko/20091014 Fedora/3.0-2.8.b4.fc11 Lightning/1.0pre Thunderbird/3.0b4

On 10/29/2009 10:02 AM, Jim Meyering wrote:
IMHO it is a bug fix.
A semantically unsigned variable must never be decremented to -1.
I didn't try to see if it could induce misbehavior.

No, it couldn't. The problem is that the variable is semantically unsigned in gnulib because of the IMHO debatable change of __re_idx_t from int to size_t, but upstream it is part of the contract that passing a negative value is acceptable (and a nop).

> >  Why use a signed type throughout rege*.[ch] when an unsigned one
> >  more accurately models the data and interfaces?
>
>  Because upstream uses a signed type, and I'm not sure we want to
>  deviate from there.  I'd use intptr_t or ptrdiff_t.

We deviated years ago.

Yes, and it's been a pain for whoever backported bugfixes. It's already hard enough to adjust the patches for int->Idx; however we complicated our lives by having to worry about signed/unsigned differences.

I know about the ABI limitations of glibc, and I'm not saying it was wrong for gnulib to switch from int to something wider. However, if we want to share the code (unlike fts, regex is sufficiently stable, complex and fundamental that we do) changing from signed to unsigned was a bad idea.

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]