Re: Coverity Open Source Defect Scan of PostgreSQL

From: "Marc G(dot) Fournier" <scrappy(at)postgresql(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Stark <gsstark(at)mit(dot)edu>, ben(at)coverity(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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-09 20:19:41
Message-ID: 20060309161835.A1178@ganymede.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 9 Mar 2006, Bruce Momjian wrote:

> Martijn van Oosterhout wrote:
> -- Start of PGP signed section.
>> On Wed, Mar 08, 2006 at 06:42:45PM -0500, Greg Stark wrote:
>>> Ben Chelf <ben(at)coverity(dot)com> 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
>>>>
>>>> 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 ;)
>>>
>>> If you're willing to require elevel to always be a constant then why not just
>>> tack on the (elevel >= ERROR ? exit(0) : 0) onto the end of the regular
>>> definition of ereport instead of having an ifdef?
>>
>> Well, the only cost would be a useless call to exit() for each
>> elog/ereport with an elevel >= ERROR. It bloats the binary a bit. Not
>> sure whether people care enough about that.
>
> We care. :-)

Why? I don't think we are able to run 'embedded' now as it is, so its not
like we're dealign with system with small disk spaces :) how much bigger
would adding that exit() make the binary? Martijn, could you do a build
with/without it and compare sizes?

----
Marc G. Fournier Hub.Org Networking Services (http://www.hub.org)
Email: scrappy(at)hub(dot)org Yahoo!: yscrappy ICQ: 7615664

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-03-09 20:31:57 Re: Coverity Open Source Defect Scan of PostgreSQL
Previous Message Andrew Sullivan 2006-03-09 20:13:54 Re: PostgreSQL Anniversary Summit, Call for Contributions