[comp.sys.amiga.tech] Help! Scanf

zerkle@iris.ucdavis.edu (Dan Zerkle) (10/21/90)

Using A3000 with 2.0 KS36.141 WB36.68
Manx's Aztec C version 5.0d (the newest).

I just installed Aztec C 5.0d and I am having MAJOR difficulties.
Please help if you can, since I need to turn in an assignment on
the 23rd, and this is really getting in my way.

To get a virgin update, I removed my old installation and installed
5.0a from scratch.  Then, I unarchived the 5.0d stuff from the first
two disks (not the 2.0 includes) over the old files.  I had to set an
option in zoo to get it to over-write the old files.

1. Less serious problem:  I can't tell the compiler or linker where
   the Aztec directories are.  When compiling, I have to throw in an
   option like "-i a:Aztec/Include" for it to find the include files.
   When linking, I have to type "-la:Aztec/Lib/m8" instead of just a
   simple "-lm8".

   The set commands in the aztec.sh sequence didn't seem to be working
   because they had quotes around parts.  I removed the quotes and now
   the set command by itself gives:

   CCTEMP       ram:
   CLIB         a:Aztec/Lib
   INCLUDE      a:Aztec/Include

   According to the 5.0b readme, the proprietary Aztec "set"
   environment command is no longer used, and indeed gives no better
   results.  So, what am I doing wrong here?


2. Critical problem:  I STILL can't get scanf() to work properly.
   According to the one person who responded (thanks!), there is a
   documented bug in 5.0a such that the 68881 version of scanf messes
   up when reading doubles.

   Example code:

   #include <stdio.h>
   main()
   {
     double dval;

     scanf("%lf",&dval);
     printf("%lf\n",dval);
   }

   cc -i a:Aztec/Include testprg.c
   ln testprg.o -la:Aztec/Lib/m -la:Aztec/Lib/c
   testprg
   5.6     <- I typed input to program
   <no output, prompt returns>

   or worse:

   cc -f8 -i a:Aztec/Include testprg.c
   ln testprg.o -la:Aztec/Lib/m8 -la:Aztec/Lib/c
   testprg
   5.6     <- I typed input to program
   <big, ugly, fat, hairy guru>

   Help!  What the ^%&(* is going on here?  The scanf bug is gone in
   5.0d, right????

             Dan Zerkle  zerkle@iris.ucdavis.edu  (916) 754-0240
           Amiga...  Because life is too short for boring computers.

zerkle@iris.ucdavis.edu (Dan Zerkle) (10/23/90)

In article <7851@ucdavis.ucdavis.edu> zerkle@iris.ucdavis.edu (Me) writes:
>I just installed Aztec C 5.0d and I am having MAJOR difficulties.
...
>2. Critical problem:  I STILL can't get scanf() to work properly.
>
>   #include <stdio.h>
>   main()
>   {
>     double dval;
>
>     scanf("%lf",&dval);
>     printf("%lf\n",dval);
>   }
>
>   cc -f8 -i a:Aztec/Include testprg.c
>   ln testprg.o -la:Aztec/Lib/m8 -la:Aztec/Lib/c
>   testprg
>   5.6     <- I typed input to program
>   <big, ugly, fat, hairy guru>

Apparently there is a bug in the 68881 scanf().  I talked to a Manx techie
this morning and gurued his machine, too.  He promised to keep in
touch and possibly fix the problem.  If you are getting bytten by this
bug, send me your e-mail address, and I'll see if I can't help you
out, too.

Of course, this doesn't help me at all on my assignment due tomorrow.

BTW, Manx tech has a Compu$erve E-mail address.  Does anyone know how
to get mail from the Internet to Compu$erve?  It would be nice to
avoid the telephone call from California to New Jersey.

				-Dan

             Dan Zerkle  zerkle@iris.ucdavis.edu  (916) 754-0240
           Amiga...  Because life is too short for boring computers.

bj@cbmvax.commodore.com (Brian Jackson) (10/23/90)

In article <7851@ucdavis.ucdavis.edu> zerkle@iris.ucdavis.edu (Dan Zerkle) writes:
>Using A3000 with 2.0 KS36.141 WB36.68
>Manx's Aztec C version 5.0d (the newest).
>
>I just installed Aztec C 5.0d and I am having MAJOR difficulties.
>
>1. Less serious problem:  I can't tell the compiler or linker where
>   the Aztec directories are.  When compiling, I have to throw in an
>   option like "-i a:Aztec/Include" for it to find the include files.
>   When linking, I have to type "-la:Aztec/Lib/m8" instead of just a
>   simple "-lm8".
>

Try the MSET command that comes with the new Manx. It uses the Amiga
ENV: variables.  My own Manx 5d startup script:


path wb2:manx5b/bin add
mset include=wb2:manx5_includes!wb2:manx5_includes/asm!wb2:headers
mset CLIB=wb2:manx5b/libs
mset CCTEMP=ram:

>2. Critical problem:  I STILL can't get scanf() to work properly.

Sorry, I never use scanf()    :)

>             Dan Zerkle  zerkle@iris.ucdavis.edu  (916) 754-0240

 -----------------------------------------------------------------------
 | Brian Jackson  Software Engineer, Commodore-Amiga Inc.  GEmie: B.J. |
 | bj@cbmvax.cbm.commodore.com    or  ...{uunet|rutgers}!cbmvax!bj     |
 |---------------------------------------------------------------------|
 | It requires a very unusual mind to undertake the analysis of        |
 | the obvious."                                                       |
 -----------------------------------------------------------------------