Re: clang's static checker report.

From: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
To: Grzegorz Jaskiewicz <gj(at)pointblue(dot)com(dot)pl>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: clang's static checker report.
Date: 2009-08-23 19:21:46
Message-ID: 80BF6479-D853-41F9-8272-52D3E5393592@pointblue.com.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


this one should contain substantialy less false positives, because
error functions were marked as the 'never exit' points:

http://zlew.org/postgresql_static_check/scan-build-2009-08-23-9/

for the record, here's patch that marks elog, etc as dead ends:

Index: src/include/utils/elog.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/utils/elog.h,v
retrieving revision 1.101
diff -u -b -r1.101 elog.h
--- src/include/utils/elog.h 11 Jun 2009 14:49:13 -0000 1.101
+++ src/include/utils/elog.h 23 Aug 2009 19:20:55 -0000
@@ -112,8 +112,8 @@
#define TEXTDOMAIN NULL

extern bool errstart(int elevel, const char *filename, int lineno,
- const char *funcname, const char *domain);
-extern void errfinish(int dummy,...);
+ const char *funcname, const char *domain)
__attribute__((analyzer_noreturn));
+extern void errfinish(int dummy,...)
__attribute__((analyzer_noreturn));

extern int errcode(int sqlerrcode);

@@ -197,7 +197,7 @@
elog_finish(int elevel, const char *fmt,...)
/* This extension allows gcc to check the format string for
consistency with
the supplied arguments. */
-__attribute__((format(printf, 2, 3)));
+__attribute__((format(printf, 2, 3)))
__attribute__((analyzer_noreturn));

/* Support for attaching context information to error reports */

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-08-23 19:24:50 Re: slow commits with heavy temp table usage in 8.4.0
Previous Message Grzegorz Jaskiewicz 2009-08-23 18:31:39 Re: clang's static checker report.