From ... From: Erik Naggum Subject: Re: READ-FROM-STRING considered unsafe? (was Re: Simple Function Question) Date: 1999/05/25 Message-ID: <3136626703930245@naggum.no>#1/1 X-Deja-AN: 481885373 References: <37406B26.C9592A04@sgi.com> <874slbzino.fsf@2xtreme.net> <87wvy7xka5.fsf_-_@2xtreme.net> <87pv3yqzvv.fsf@pc-hrvoje.srce.hr> <87ogjiibfi.fsf@pc-hrvoje.srce.hr> <87zp31cd75.fsf@pc-hrvoje.srce.hr> <87g14riexc.fsf@pc-hrvoje.srce.hr> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * Johan Kullstam | [1] C cannot pass floats, only doubles hence both floats and doubles | are printed with %f but scanned with %f and %lf respectively. FWIW, this is no longer true. ANSI C, published a decade ago, specified that if the prototype is in scope, a function call should coerce an argument to the appropriate numeric type, including short, float, etc, and the function can expect the object to have the specified type. if the prototype is not in scope, certain defaults apply that should cause an error to be reported when a conflicting prototype is seen. the reason C cannot do %f as anything but double is that there is no prototype for printf (etc) that could request any particular type, hence the default conversions apply. #:Erik -- @1999-07-22T00:37:33Z -- pi billion seconds since the turn of the century