pspp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contribution and cvs


From: John Darrington
Subject: Re: contribution and cvs
Date: Tue, 23 Aug 2005 12:54:14 +0800
User-agent: Mutt/1.5.9i

On Sun, Aug 21, 2005 at 02:39:16PM -0700, Ben Pfaff wrote:
     
        * I saw code like this in a few places:
     
            {
              errno = ENODATA;
              fprintf( stderr, "%s:%d: %s\n",__FILE__,__LINE__,
                       strerror(errno));
              err_cond_fail();
            }
     
          I'm not sure what the goal is here.  Does this code only
          execute if there is a bug in the code?  If so, then I'd
          prefer to see it written as simply `assert (0);' (or a more
          descriptive assertion) or even just `abort ();'.  If not,
          then it would be better to give a meaningful error
          message--users can't be expected to understand this kind of
          message.
     
I'd suggest #including error.h using assert.  error.h defines assert to 
call request_bug_report_and_abort, so it gives the user-understandable message.

J'


-- 
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://pgp.mit.edu or any PGP keyserver for public key.


Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]