🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #57

Re: strins()

#57
From: Darren New
Date: Thu, 15 Jun 1989 17:28
21 lines
1647 bytes
In article <3930@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
>In article <8906150029.AA22430@jade.berkeley.edu>, C506634@UMCVMB.BITNET ("Eric Edwards") writes:
>> Lattice uses a bultin function to get arround this problem in printf.
>> "     printf
>> *  When it is a constant string with no substitutions, the compiler changes the
>>    printf call to a _write call.
>
>What if you have your own version of printf? Say, one that understands more
>escape sequences (%e -- error text, %t -- absolute tab, %l -- length byte)?

The way this works in LC4.0 (and I would suspect 5.0) is that stdio.h has
a #define printf __builtin_printf. Taking this line out (or #undef) would
turn this back into a normal function. Redefining printf seems kind of dubious 
to me, knowing the little I do about ANSI. This is also used to inline
strcpy, strcat, and a couple others (in 4.0).

>Can you freely interleave _write with stdio routines?
Not standardly. I would think that you would change it to puts(), myself.
>Does it work if you have freopened stdout?
Which would cure this problem also. I'm interested in seeing what they
do in 5.0 also (just ordered it today..) -- Darren
Technical Details
Message-ID: <17740@louie.udel.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!udel!new
References: <8906150029.AA22430@jade.berkeley.edu> <3930@sugar.hackercorp.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!njin!princeton!udel!new
From: new@udel.EDU (Darren New)
Newsgroups: comp.sys.amiga.tech
Subject: Re: strins()
Message-ID: <17740@louie.udel.EDU>
Date: 15 Jun 89 17:28:21 GMT
References: <8906150029.AA22430@jade.berkeley.edu> <3930@sugar.hackercorp.com>
Sender: usenet@udel.EDU
Reply-To: new@udel.EDU (Darren New)
Organization: University of Delaware
Lines: 21