This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: RFA: fix PR python/11915


> From: Tom Tromey <tromey@redhat.com>
> Cc: gdb-patches@sourceware.org
> Date: Mon, 23 Aug 2010 11:03:30 -0600
> 
> >>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:
> 
> Eli> "Inclusive upper bound"?  Does this mean that if the argument is N,
> Eli> then the array will have N+1 members, from zero to N?  That sounds
> Eli> against the intuition, doesn't it?
> 
> Yes, but it is the only way to allow an array whose upper bound is
> MAXINT.  I think it is also consistent with Type.range.

It means I'd need to use an argument of zero to have an array of one
element.  It also means the size of an array whose upper bound is
MAXINT is MAXINT+1, which could overflow, no?

I'm fine with this if users will be, but it feels strange.

> >> +given, the first argument is the lower bound of the array, and the
> >> +second argument is the upper bound of the array.
> 
> Eli> Will the reader know whether negative arguments are allowed (provided
> Eli> that the second is greater than the first)?  Or is it a good idea to
> Eli> tell explicitly?
> 
> I added a note.  New patch appended.

Thanks, this version is fine with me.


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