Why is sprintf ifdef-ed out of <stdio.h>?

Root Boy Jim rbj at dsys.ncsl.nist.gov
Thu Aug 24 07:37:25 AEST 1989


? From:    Chris Torek <chris at mimsy.umd.edu>

? bob at omni.com (Bob Weissman) asks why there is an `#ifdef vax' around the
? `char *sprintf()' declaration in stdio.h.

? The reason is that sprintf() is supposed to return an int value, namely
? the number of characters printed, but it was `too painful' to fix this for
? 4.2 and 4.3 BSD, so it was left *wrong* in the BSD VAX systems and made
? correct in SunOS.

Made correct in which version? I ran a test prog under 3.5 and it returns
the first arg. My Version 4 (probably 4.0) manual sez that it still
returns char *. I have no access to a running 4.x system.

? Why the `#ifdef vax' ... `#endif' lines were never removed from the Sun
? stdio.h I cannot answer.  Note that sprintf() has been fixed in
? 4.3BSD-tahoe.

Perhaps your local SunOS/BSD hybrid has the Tahoe sprintf?

? In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
? Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris

	Root Boy Jim
	Have GNU, Will Travel.



More information about the Comp.sys.sun mailing list