Re: clang's static checker report.

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: clang's static checker report.
Date: 2009-08-23 16:47:46
Message-ID: 3CD58E90-0CD4-4E8E-A3C8-2EF250D9E28F@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 23 Aug 2009, at 17:41, Greg Stark wrote:

> On Sun, Aug 23, 2009 at 4:57 PM, Grzegorz Jaskiewicz<gj(at)pointblue(dot)com(dot)pl
> > wrote:
>> I am sure there's plenty of false positives, but I am also quite sure
>> there's many real errors on that list.
>
> Do you know how to teach clang about functions which never return?
> That seems to be causing most of the false positives because it
> doesn't recognize that our error checks stop execution and avoid the
> use of the unitialized variables afterwards.

I am not the clang developer, so I honestly have no idea how to do it.
But as far as I checked report myself, there's couple 'division by
zero', and 'null reference' errors that looked plausible to someone
as unfamiliar with the postgresql's source as myself.
Like with all static checkers, this one will generate a lot of false
positives, and it is the inevitable cost of using such a tool having
to go through all errors and sieve out positives yourself.

You probably refer to the functions that never return. Sadly, even tho
llvm clang is capable of doing so (one of its strengths is linking
optimization) - the checker is unable to cross reference files, or so
it seems.

Well, like I said - l hope at least part of that report is useful.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2009-08-23 16:47:49 Re: clang's static checker report.
Previous Message Roger Leigh 2009-08-23 16:43:16 Re: [PATCH 5/6] psql: print_aligned_text uses table formatting