Subject: Re: READ-FROM-STRING considered unsafe? (was Re: Simple Function Question)
From: Erik Naggum <erik@naggum.no>
Date: 1999/05/25
Newsgroups: comp.lang.lisp
Message-ID: <3136626703930245@naggum.no>

* Johan Kullstam <kullstam@ne.mediaone.net>
| [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