OK, comments removed, and comment added to port/strtol.c.
---
Tom Lane wrote:
> Bruce Momjian writes:
> > I modified it to:
> > errno = 0; /* avoid having to check the result for failure */
>
> Just for the record
Martijn van Oosterhout writes:
> errno = 0; /* clear prior detected errors */
That one is at least a correct explanation of what the code is doing...
regards, tom lane
---(end of broadcast)---
TIP 4: Have you search
Bruce Momjian writes:
> I modified it to:
> errno = 0; /* avoid having to check the result for failure */
Just for the record, that's *still* wrong. It implies that if we
tested (result == LONG_MAX && errno == ERANGE), without zeroing
errno beforehand, the code would be correct. But it
Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Thu, Dec 01, 2005 at 04:12:30PM -0500, Bruce Momjian wrote:
> > Well, there seems to be enough confusion, even in this email list, that
> > identifying _why_ errno is being cleared is a good idea.
> >
> > I modified it to:
> >
> >
On Thu, Dec 01, 2005 at 04:12:30PM -0500, Bruce Momjian wrote:
> Well, there seems to be enough confusion, even in this email list, that
> identifying _why_ errno is being cleared is a good idea.
>
> I modified it to:
>
> errno = 0; /* avoid having to check the result for failure */
I d
Bruce Momjian wrote:
> Tom Lane wrote:
> > > or should I add a macro to c.h as:
> >
> > > /* Sometimes we need to clear errno so we can check errno
> > >* without having to check for a failure value from the function
> > >* call.
> > >*/
> > > #define CLEAR_ERRNO \\
> > > d
Tom Lane wrote:
> Bruce Momjian writes:
> > Should I just change them all to:
>
> > errno = 0; /* avoid checking result for failure */
>
> No, that's still a completely inaccurate description of the reason
> for having the statement.
>
> > or should I add a macro to c.h as:
>
> > /* S
Bruce Momjian writes:
> Should I just change them all to:
> errno = 0; /* avoid checking result for failure */
No, that's still a completely inaccurate description of the reason
for having the statement.
> or should I add a macro to c.h as:
> /* Sometimes we need to clear errno so
Tom Lane wrote:
> [EMAIL PROTECTED] (Bruce Momjian) writes:
> > Log Message:
> > ---
> > Add comments about why errno is set to zero.
>
> These comments seem a bit wrongheaded, since "checking
> LONG_MIN/LONG_MAX" is exactly not what we could do to detect an overflow
> error.
Yea, I notic