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

From Grzegorz Jaskiewicz
Subject Re: clang's static checker report.
Date
Msg-id 61BBC425-BD75-4DC9-8BE3-A6570E41D08B@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
ok folks, here's the last one for Today:

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

tar ball with report can be downloaded from here:
http://zlew.org/postgresql_static_check/postgresql_static_check_23rdAugust2009.tar.xz  (compressed with lzma's xz
tool).

here's the patch for elog stuff:

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 22:16:05 -0000
@@ -104,7 +104,7 @@  */ #define ereport_domain(elevel, domain, rest)    \     (errstart(elevel, __FILE__, __LINE__,
PG_FUNCNAME_MACRO,domain) ? \
 
-     (errfinish rest) : (void) 0)
+     (errfinish rest) : (void) 0), (elevel >= ERROR) ? exit(1) : 0
 #define ereport(elevel, rest)    \     ereport_domain(elevel, TEXTDOMAIN, rest)
@@ -190,7 +190,7 @@  *        elog(ERROR, "portal \"%s\" not found", stmt->portalname);  *----------  */
-#define elog    elog_start(__FILE__, __LINE__, PG_FUNCNAME_MACRO),  
elog_finish
+#define elog(A, ...)    elog_start(__FILE__, __LINE__,  
PG_FUNCNAME_MACRO), elog_finish(A, __VA_ARGS__), (A >= ERROR) ?  
exit(1) : 0
 extern void elog_start(const char *filename, int lineno, const char  
*funcname); extern void


hopefully satisfying everyone.

Hope to see few fixes out of that ;)

thanks.





pgsql-hackers by date:

Previous
From: Grzegorz Jaskiewicz
Date:
Subject: Re: clang's static checker report.
Next
From: Alvaro Herrera
Date:
Subject: Re: [PATCH 5/6] psql: print_aligned_text uses table formatting