Bug Report.

Amitoj G. Singh amitoj@cs.uh.edu
Mon Apr 2 14:22:00 GMT 2001


Hi,
  Tried complining the following class assignment. Got this bug report.

$>> gcc pro7.c
pro7.c: In function `inputIDsScores':
pro7.c:26: Internal compiler error in fix_lexical_addr, at function.c:5320
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

/* Program follows from here **********************/
/* program 7
   Scores                               */

#define MAX_STUDENTS 50
#define MAX_SCORES 10

main()

{

 int id[MAX_STUDENTS];
 int m,n,MAX_STUDENT;
 int lowsum, highsum, avgsum;
 double scores[MAX_STUDENT][MAX_SCORES], sum[ MAX_STUDENTS],
avg[MAX_SCORES];
 void inputIDsScores(int id[MAX_STUDENTS], double
scores[MAX_STUDENT][MAX_SCORES], int m, int n); 

inputIDsScores(id,scores,m,n);
sumRows(scores, sum, m,n);
avgCols(scores,avg,m,n);
computeStates(sum, avgsum,lowsum,highsum,m);
outputResults(id,scores,sum,avg,avgsum,lowsum,highsum,m,n);
}

void inputIDsScores(int id[], double scores[][MAX_SCORES], int *mp, int
*np)
{
 int flag =0;
 int i, mp;
 int j=0;
 int np;
 int k;

 mp =0;

 /* mp is the number of rows(number of student IDs)  */
 // np is the number of columns (scores of students)

//////ask user to enter number of scores of each student; -> np;
printf("Enter the number of scores each student has this semester:  ");
scanf("%d", &numberofscores);
printf("For each student enter an ID and %d scores. Enter -1 for the ID to
end input");
while (flag !=-1)
{
   
   ///////ask user to enter ID; ->k;
printf("Enter the ID");
scanf("%d",&k);

if (k!=-1)
{
 id[j]=k;
 mp=mp+1;
}
    else
{
    flag = -1;
}
    if (flag != -1)
{
    j=j+1;
for (i=0; i<np; i=i+1)
    {
      /////////ask user to enter score one by one; -> scores[j][i]
    printf("enter scores one by one");
    scanf("%d %d %d %d %d", &scores[j][i]);

    }
   }
  }
return;
}
void sumRows(const double scores[][MAX_SCORES], double sum[], int m , int
n)
{
  int i;
  int j;
  int temp ; 
  for (i=o; i<m; i=i+1)
{
  temp =0;
for (j=0; j<n; j=j+1)
{
temp=temp+scores[i][j];

 }
   sum[i]=temp;
}
return;
}
void avgCols (const double scores[][MAX_SCORES],double avg[], intm, intn)
{
int i;
int j;
int temp;
for ( i=0; i<n; i=i+1)
{
temp =0
for (j=0; j<m; j=j+1)
{
   temp=temp+scores[j][i];
}

 .. .. .......



More information about the Gcc-bugs mailing list