[4592] in Athena Bugs
vax 6.4R: dbx
daemon@ATHENA.MIT.EDU (vanharen@ATHENA.MIT.EDU)
Wed Mar 21 18:57:17 1990
From: vanharen@ATHENA.MIT.EDU
To: bugs@ATHENA.MIT.EDU
Cc: cp@ATHENA.MIT.EDU
Date: Wed, 21 Mar 90 18:56:56 EST
System name: fries
Type and version: CVAXSTAR 6.4R
Display type: SM
What were you trying to do?
Print the return value of a function.
What's wrong:
dbx barfs and prints zero, no matter what I ask of it.
What should have happened:
It should work, as it does on the RT.
In detail: -------------------------------------------------------------
The following program, when compiled and loaded into dbx, works
correctly when you ask it to "print square(5)" (it prints back "25"):
#include <stdio.h>
void main()
{ int x;
x = square( 2 );
}
int square(x)
int x;
{
return (x*x);
}
This program however, causes dbx to lose. Compiling it, loading it into
dbx, and typing "print square(5)" (or any value, squared), prints
back "0":
#include <stdio.h>
void main()
{ int x;
x = square( 2 );
printf("The cow jumped over the moon."); /** THIS IS THE ONLY DIFF **/
}
int square(x)
int x;
{
return (x*x);
}