gtchen@faline.bellcore.com (George T. Chen) (09/11/87)
Has anyone had this problem?
...
void get_value(size)
long *size;
{ ...(do some processing)...
printf("%ld",*size);
}
void routine()
{ ...(some declarations)...
long size;
...(some other stuff)....
get_value(&size);
printf("%ld",size);
}
This routine dies on me! (Well not dies but doesn't work) For some
reason, size is correct in the get_value routine, but seems to be
int(size/256.)*256 in the calling routine. Almost as if the least
significant byte became 0. However, if I now change routine to
void routine()
{ ...(same declarations)...
long garbage,size;
...(same other stuff)....
get_value(&size);
printf("%ld",size);
garbage = 0; /* So that garbage is allocated memory instead */
/* of being ignored by the compiler */
}
then everything works fine and dandy. What's going on? Someone told
me it might be a problem with odd and even bytes, but I don't quite
understand that. All help appreciated.
--
+-----------------------------------------------------------------------------+
|What's a .signature? Life is an equation whose only solutions are irrational |
|gtchen@thumper.bellcore.com ! gtchen@romeo.caltech.edu ! gtchen@where.am.i?. |
+-----------------------------------------------------------------------------+