[comp.sys.sun] Sun386i, cc and calctool

francis%catuc.UUCP@arizona.edu (02/19/89)

This is the third time I have submitted this article to sun-spots: the
requests must be getting lost!

[[ No, they were being sent to the wrong address!  If you want to mail a
submission to the digest, please send it to "sun-spots@rice.edu".  Thank
you.  --wnl ]]

In a followup to the article I posted trying to find out why I couldn't
compile the cacltool program written by Chuck Musciano on my 386i,  I
narrowed the problem to the C Compiler.  For those of you interested, try
to compile the code fragment (isolated by Peter Collins):

   main()
   {
	   int     i;
	    double v_stack[100];
	    int    v_top;

	    i = ~ (unsigned int) v_stack[v_top];
   }

cc never returns on my machine.  The work around that I found was to do
the following:

   main()
   {
	   int    i;
	   double v_stack[100], vs;
	   int    v_top;

	   vs = v_stack[v_top];
	   i =  ~ (unsigned int) vs;
   }

Anyway, there are about 20 lines like the assignement statement in the bad
example above in the file 'ops.c' in the calctool shar.  Just apply the
technique shown above to each case.

Francis Sullivan
Computer Automation, Tucson, AZ
...!hao!noao!arizona!catuc!francis
catuc!francis@arizona.edu

scott@uunet.uu.net (Scott Boyd) (03/04/89)

francis%catuc.UUCP@arizona.edu writes:
>In a followup to the article I posted trying to find out why I couldn't
>compile the cacltool program written by Chuck Musciano on my 386i,  I
>narrowed the problem to the C Compiler....

Yup. The C compiler goes bye-bye on any unsigned long or int cast that
references either an array or a pointer. 

Given legitimate definitions any of the following will hang the C compiler
on the 386i.

	l = (unsigned long) ptr->value;
	i = (unsigned int) ptr->value;
	l = (unsigned long) array[index];
	i = (unsigned int) array[index];

This is with the 4.0.1 release of SunOS on a 386i/250.
-- 
Scott Boyd                                            Commodity Futures, Inc.
uunet!futures!scott	                              P.O. Box 620484
                                                      Woodside, CA 94062