Date: Tue, 4 Dec 2001 02:01:22 +0100 (CET)

   On  4 Dec, Sven Neumann wrote:

   > Using them for error reporting is definitely a bad idea. Using a
   > negative value to indicate that a value has not been set and needs to
   > be computed is IMO a reasonable usage.

   On a side note: I found it quite often that the return value is set
   to something in case it's real value couldn't be computed, this is
   also some form of error indication which I'd like to avoid: A
   function fails or succeeds and in either case appropriate steps
   have to be taken; just propagating the error code down to the
   original caller in the hope to catch it there is IMHO a bad idea.

Why?  If a function is explicitly documented as returning an error,
it's the caller's responsibility to handle it.  The callee often
doesn't know the high level context to handle it in a useful fashion.

Robert Krawitz <[EMAIL PROTECTED]>

Tall Clubs International  -- or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail [EMAIL PROTECTED]
Project lead for Gimp Print/stp --

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton
Gimp-developer mailing list

Reply via email to