[comp.sys.amiga] strins

C506634@umcvmb.missouri.edu (Eric Edwards) (06/16/89)

In Measage ID<256@maytag.waterloo.edu> giguere@aries5.uucp says:
>If you're trying to write small programs with as little library
>overhead as possible you should avoid any of the (f/s/v)printf routines
>if at all possible.  As anyone who's looked through the bowels of a C
>compiler knows, the printf routines are some of the largest routines
>around and non-trivial to code.  That's why the standard program
>
>     main()
>       {
>         printf( "hello, world\n" );
>       }
>
>is actually more of a test for the C compiler than you'd normally think.

Lattice uses a bultin function to get arround this problem in printf.
I quote from the Lattice manual, _Lattice C Compiler_ version 4.0

"     printf

When this function is called, the compiler examines the formatting string:

*  When it is a constant string with no substitutions, the compiler changes the
   printf call to a _write call.
*  When it is a constant string AND only contains %s, %d and p% formats a call
   is made to _tinyprintf "

Disclaimer:  All typos are assumed to be mine, not the manual's.

Further they say they may do similar tricks for scanf, sprintf and fprintf but
upon checking my 5.0 manual I don't thing they have done this to date.

>Eric Giguere                                  268 Phillip St #CL-46
>For the curious: it's French ("jee-gair")     Waterloo, Ontario  N2L 6G9

Bitnet:    C506634@umcvmb.bitnet                    __________________________
Internet:  C506634@umcvmb.missouri.edu             / \.--------.           /  \
"The Amiga just isn't reliable enough unless you   |  | Eric   |---------+    |
know a lot about the machine" -- Jerry Pournelle   |  `--------'         !    |
  ================================================||  .--------.         !    |
"I did notice that at my party people stood in     |  | Edwards|_________+    |
 line to play with the Amiga"-- Jerry Pournelle    | /`--------'             |
                           BYTE, October '88       \__________________________/