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: Paolo Bonzini
Subject: Re: [RFC PATCH] dfa: make position_sets grow automatically
Date: Tue, 05 Jul 2011 11:43:39 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Mnenhy/0.8.3 Thunderbird/3.1.10

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?

Paolo



reply via email to

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