Re: Coverity Open Source Defect Scan of PostgreSQL

From: Ben Chelf <ben(at)coverity(dot)com>
To: Martijn van Oosterhout <kleptog(at)svana(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Neil Conway <neilc(at)samurai(dot)com>, Andreas Pflug <pgadmin(at)pse-consulting(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Coverity Open Source Defect Scan of PostgreSQL
Date: 2006-03-08 17:20:24
Message-ID: 440F1258.5040507@coverity.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Martijn van Oosterhout wrote:
> On Tue, Mar 07, 2006 at 05:39:18PM -0500, Tom Lane wrote:
>
>>Martijn van Oosterhout <kleptog(at)svana(dot)org> writes:
>>
>>>#ifdef STATIC_ANALYSIS
>>>#define ereport(elevel, rest) \
>>> (errstart(elevel, __FILE__, __LINE__, PG_FUNCNAME_MACRO) ? \
>>> (errfinish rest) : (void) 0), (elevel >= ERROR ? exit(0) : 0)
>>>#else
>>>/* Normal def */
>>>#endif
>>
>>Hmm, neat idea ... though I wonder whether either gcc or Coverity's tool
>>is smart enough to draw the right conclusions from a conditional exit()
>>call ...
>

As for Coverity, if the elevel that's passed to the ereport is really a
constant, the above #ifdef should absolutely do the trick for us so we
know to stop analyzing on that path...Let me know if it doesn't actually
do that ;)

-ben

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2006-03-08 17:49:04 Re: Merge algorithms for large numbers of "tapes"
Previous Message Greg Stark 2006-03-08 17:03:07 Re: Add switches for DELIMITER and NULL in pg_dump COPY