C Builtin Funxions

zben at umd5.UUCP zben at umd5.UUCP
Sun Apr 20 05:55:00 AEST 1986


>>> Some of us know what we're doing. One sees lots of redefinitions of
>>> things like `putc' in {VM,}UNIX code. It is often desirable to use
>>> high level funxions (printf) while hacking up a lower level one.
	
>> Of course, you realize redefining putc will have no effect on printf...

> I could redefine printf to remove all that floating point stuff I
> don't want or need, and maybe add a few formats of my own (You hear
> a faint cry of anguish (about portability) in the background).
> THEN, I am free to redefine putc, perhaps to print unprintable
> chars as ^X for control X, etc. In fact I did this to `more'.

At first blush one might think this a very lazy thing to do.  Pity the poor
dude who gets this program after you leave - and has to deal with one of
the inter-library-routine calling sequences subtly shifting in 4.7 BSD*.

If you're going to redefine the world, what's wrong with 1,$s/putc/myputc/g
and 1,$s/printf/myprintf/g and be done with it - then the fact that you
have hacked things up is "manifestly obvious".

*This is an out-of-the-hat example - do *NOT* write me asking for distapes.

-- 
"We're taught to cherish what we have   |          Ben Cranston
 by what we have no longer..."          |          zben at umd2.umd.edu
                          ...{seismo!umcp-cs,ihnp4!rlgvax}!cvl!umd5!zben  



More information about the Comp.lang.c mailing list