Re: clang's static checker report. - Mailing list pgsql-hackers

From Grzegorz Jaskiewicz
Subject Re: clang's static checker report.
Date
Msg-id 80BF6479-D853-41F9-8272-52D3E5393592@pointblue.com.pl
Whole thread Raw
In response to Re: clang's static checker report.  (Grzegorz Jaskiewicz <gj@pointblue.com.pl>)
Responses Re: clang's static checker report.
List 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
stringfor  
 
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 */




pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH 5/6] psql: print_aligned_text uses table formatting
Next
From: Tom Lane
Date:
Subject: Re: slow commits with heavy temp table usage in 8.4.0