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: [patch-readline] history file reading


> Date: Tue, 21 Mar 2006 10:33:08 -0500
> From: Bob Rossi <bob_rossi@cox.net>
> Cc: Denis PILAT <denis.pilat@st.com>, Chet Ramey <chet.ramey@case.edu>,
> 	Eli Zaretskii <eliz@gnu.org>, gdb-patches@sources.redhat.com,
> 	bash-maintainers@gnu.org
> 
> > line_end[-1] whould be much better readable, IMHO.
> 
> Can you even index into an array with a negitive number?

Yes, provided that the result is valid, i.e. it doesn't reference an
address outside the array.

In fact, in C, `*(foo -1)' and `foo[-1]' is literally the same thing
by the language rules, and the compiler produces identical code for
both expressions.


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