Skip site navigation (1) Skip section navigation (2)

Re: clang's static checker report.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Alex Hunsaker <badalex(at)gmail(dot)com>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: clang's static checker report.
Date: 2009-08-30 18:33:47
Message-ID: 18257.1251657227@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)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

In response to

Responses

pgsql-hackers by date

Next:From: Josh BerkusDate: 2009-08-30 20:05:25
Subject: Re: 8.5 release timetable, again
Previous:From: Grzegorz JaskiewiczDate: 2009-08-30 18:28:21
Subject: Re: clang's static checker report.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group