[comp.sys.mac.programmer] TC4.0 - problems with sscanf

myoung@joker.sgi.com (Mark Young) (08/12/90)

I have a piece of code that is similar to:

    {
        float a = 1.0;
        float b = 2.0;
        float c = 3.0;
        char *s = "6.02";

        sscanf(s,"%f",&b);
    }

when I compile the code with the 68881 compiler option DISabled, the code
works as you would expect.  with the 68881 option ENabled, the result in
the variable 'b' is ok, but the value in 'a' is getting munged by the call
to sscanf().

is there a patch for this?  I looked at the code to verify that the
absence of a length modifier in the format implies single precision and 
found that I was correct.  I really don't want to have to waste the time
tracking this down if it's already been fixed.

any leads are welcome.

	...myoung@joker.asd.sgi.com

lim@iris.ucdavis.edu (Lloyd Lim) (08/13/90)

In article <11679@odin.corp.sgi.com> myoung@joker.sgi.com (Mark Young) writes:
>when I compile the code with the 68881 compiler option DISabled, the code
>works as you would expect.  with the 68881 option ENabled, the result in
>the variable 'b' is ok, but the value in 'a' is getting munged by the call
>to sscanf().

Are you using the right version of the libraries?  There's a different version
to use when the 68881 option is on.

+++
Lloyd Lim     Internet: lim@iris.ucdavis.edu (128.120.57.20)
              Compuserve: 72647,660
              US Mail: 146 Lysle Leach Hall, U.C. Davis, Davis, CA 95616