Re: clang's static checker report. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: clang's static checker report.
Date
Msg-id 18257.1251657227@sss.pgh.pa.us
Whole thread Raw
In response to Re: clang's static checker report.  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Responses Re: clang's static checker report.  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
List pgsql-hackers
Grzegorz Jaskiewicz <gj@pointblue.com.pl> writes:
> On 30 Aug 2009, at 19:14, Tom Lane wrote:
>> Yes, it's bogus.  ctid is never passed as NULL.  It might point at
>> an "invalid" itempointer (one with ip_posid == 0).  Look at the only
>> call site.

> so why do we check if the pointer is valid ?

[ shrug... ]  The macro is more general than is necessary in this
specific context.  In an actual build I'd expect the compiler to figure
out that the null-pointer test is redundant and optimize it away, since
after inlining it would see that ctid is the address of a local variable.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: clang's static checker report.
Next
From: Josh Berkus
Date:
Subject: Re: 8.5 release timetable, again