Re: [COMMITTERS] pgsql: Add comments about why errno is - Mailing list pgsql-hackers

From Neil Conway
Subject Re: [COMMITTERS] pgsql: Add comments about why errno is
Date
Msg-id 1133475547.16064.3.camel@localhost.localdomain
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add comments about why errno is set  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: [COMMITTERS] pgsql: Add comments about why errno is  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, 2005-12-01 at 16:38 -0500, Bruce Momjian wrote:
> Maybe it should be:
> 
>     errno = 0;    /* Allow unconditional errno check */

I think any solution that involves adding more duplication at each
strtol() callsite is not great ("Don't Repeat Yourself"). I'd still like
to see this refactored into a separate function, as I suggested on
-patches. If people would like to see a detailed explanation of the
interaction between strtol() and errno, a header comment to pg_strtol()
seems a good place to put it. IMO that is better than copying and
pasting a cryptic one-line comment to each and every callsite of
strtol().

-Neil




pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [COMMITTERS] pgsql: Add comments about why errno is set
Next
From: Bruce Momjian
Date:
Subject: Re: Improving count(*)