bug-grep
[Top][All Lists]
Advanced

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

Re: [RFC PATCH] dfa: make position_sets grow automatically


From: Jim Meyering
Subject: Re: [RFC PATCH] dfa: make position_sets grow automatically
Date: Tue, 05 Jul 2011 11:56:26 +0200

Paolo Bonzini wrote:

> On 07/04/2011 03:46 PM, Jim Meyering wrote:
>> Finally, to avoid the risk of error with negative "index", I suggest to
>> change the semantics by incrementing that argument by 1 at each macro use
>> and changing the name to "n_items".
>
> At this point, and if we stick with unsigned types for sizes, the
> assertion on 0 < (n_required) becomes pointless (it should become 0 <=
> (n_required) and that is always true for unsigned types).  It even
> gets in the way when applying REALLOC_IF_NECESSARY to the copy
> function, because it is sometimes called with a zero-element source.
> What about removing the assertion altogether?

Yes, definitely remove it.
Otherwise, I suspect it'd provoke a warning about the always-true expression.



reply via email to

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