sprintf(3s) query

Doug Gwyn gwyn at smoke.BRL.MIL
Fri Dec 9 03:04:40 AEST 1988


In article <1102 at entropy.ms.washington.edu> charlie at mica.stat.washington.edu (Charlie Geyer) writes:
>It seems that in 4.3 BSD (and before?) sprintf doesn't lint right
>except on a VAX.

Actually the VAX version is wrong.  sprintf() is supposed to return int.
This wasn't clearly specified in the "good old days", and since one
implementation accidentally returned the buffer address, somebody thought
that was supposed to be the definition.

>  (1) What is "too painful to do right" and why?

Presumably somebody realized that it was wrong but thought there was
too much code that relied on the BSD behavior.  (E.g. "rogue" did this.)



More information about the Comp.lang.c mailing list