Bug 111394 - broken source code
Summary: broken source code
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: transfig (Show other bugs)
(Show other bugs)
Version: 1
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Ngo Than
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-12-02 23:07 UTC by d.binderman
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-11-30 21:24:24 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description d.binderman 2003-12-02 23:07:44 UTC
Description of problem:
I just tried to compile package transfig-3.2.4-5 from Fedora.

The compiler said

1.

genmp.c:649: warning: operation on `j' may be undefined
genmp.c:653: warning: operation on `j' may be undefined

The source code is

	for ( ; p->next != NULL; ) {  /* 3 or more points */
		fprintf(tfp,"    p%d..controls c%d and c%
d..\n",i++,j++,j++);
		p = p->next;
	}
	if (s->type == 1)     /* closed spline */
		fprintf(tfp,"    p%d..controls c%d and c%
d..cycle;\n",i++,j++,j++);

This source code is undefined because j is incremented twice between
sequence points. Better source code is

	for ( ; p->next != NULL; ) {  /* 3 or more points */
		fprintf(tfp,"    p%d..controls c%d and c%d..\n",i++, 
j, j + 1);
		j += 2;
		p = p->next;
	}
	if (s->type == 1)     /* closed spline */
	{
		fprintf(tfp,"    p%d..controls c%d and c%
d..cycle;\n",i++, 
					j, j + 1);
		j += 2;
	}



Version-Release number of selected component (if applicable):
transfig-3.2.4-5 

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Ngo Than 2004-11-30 21:24:24 UTC
it's now fixed in 3.2.4-9 or newer. Thanks for your report.


Note You need to log in before you can comment on or make changes to this bug.