Bug 246740

Summary: texinfo-4.8-49 : array subscript is below array bounds
Product: [openSUSE] openSUSE 10.3 Reporter: David Binderman <dcb314>
Component: OtherAssignee: Dr. Werner Fink <werner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None    
Version: Alpha 1   
Target Milestone: ---   
Hardware: All   
OS: SUSE Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description David Binderman 2007-02-19 12:03:46 UTC
I just tried to compile package texinfo-4.8-49
with the GNU C compiler version 4.3 snapshot 20070216.

The compiler said

xml.c:660: warning: array subscript is below array bounds

The source code is

  return element_stack[element_stack_index-1];

but in routine xml_pop_current_element is the line

	  if (element_stack_index < 0)

Suggest code rework.
Comment 1 Dr. Werner Fink 2007-02-19 13:27:07 UTC
Please do your report also upstream, I've no time to determine how this code
should work.
Comment 2 David Binderman 2007-02-19 13:32:39 UTC
(In reply to comment #1)
> Please do your report also upstream, 

Thanks for the offer, but I have no experience 
with this package and so it is likely I will break the package.

>I've no time to determine how this code should work.

Not a problem. Suggest postpone fix until convenient time.
Comment 3 Dr. Werner Fink 2007-02-19 13:46:02 UTC
AFAIS from CVS of texinfo at cvs.savannah.gnu.org they have included
an `assert(element_stack_index > 0);' before the compromised line.
Does this stop gcc shouting about the array subscript in the
reported return line?
Comment 4 Dr. Werner Fink 2007-02-19 14:11:59 UTC
I'm using parts of the cvs version, seems to compile without warning
at least with gcc 4.2.0_20070130