summaryrefslogtreecommitdiff
path: root/src/include/utils
diff options
context:
space:
mode:
authorTom Lane2020-03-25 15:57:36 +0000
committerTom Lane2020-03-25 15:57:36 +0000
commitbda6dedbea599209048bc51115ecb2062ceb976c (patch)
tree978a9e7efd646601f82780c6dcd41eb274f29acc /src/include/utils
parentf5817595a7f194d25bc9be5b035eb1f7f60cd1fa (diff)
Go back to returning int from ereport auxiliary functions.
This reverts the parts of commit 17a28b03645e27d73bf69a95d7569b61e58f06eb that changed ereport's auxiliary functions from returning dummy integer values to returning void. It turns out that a minority of compilers complain (not entirely unreasonably) about constructs such as (condition) ? errdetail(...) : 0 if errdetail() returns void rather than int. We could update those call sites to say "(void) 0" perhaps, but the expectation for this patch set was that ereport callers would not have to change anything. And this aspect of the patch set was already the most invasive and least compelling part of it, so let's just drop it. Per buildfarm. Discussion: https://postgr.es/m/CA+fd4k6N8EjNvZpM8nme+y+05mz-SM8Z_BgkixzkA34R+ej0Kw@mail.gmail.com
Diffstat (limited to 'src/include/utils')
-rw-r--r--src/include/utils/elog.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index d244b1c0ac5..1e09ee05418 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -149,30 +149,30 @@
extern bool errstart(int elevel, const char *domain);
extern void errfinish(const char *filename, int lineno, const char *funcname);
-extern void errcode(int sqlerrcode);
+extern int errcode(int sqlerrcode);
-extern void errcode_for_file_access(void);
-extern void errcode_for_socket_access(void);
+extern int errcode_for_file_access(void);
+extern int errcode_for_socket_access(void);
-extern void errmsg(const char *fmt,...) pg_attribute_printf(1, 2);
-extern void errmsg_internal(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errmsg(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errmsg_internal(const char *fmt,...) pg_attribute_printf(1, 2);
-extern void errmsg_plural(const char *fmt_singular, const char *fmt_plural,
+extern int errmsg_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
-extern void errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
-extern void errdetail_internal(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errdetail_internal(const char *fmt,...) pg_attribute_printf(1, 2);
-extern void errdetail_log(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errdetail_log(const char *fmt,...) pg_attribute_printf(1, 2);
-extern void errdetail_log_plural(const char *fmt_singular,
+extern int errdetail_log_plural(const char *fmt_singular,
const char *fmt_plural,
unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
-extern void errdetail_plural(const char *fmt_singular, const char *fmt_plural,
+extern int errdetail_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n,...) pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
-extern void errhint(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errhint(const char *fmt,...) pg_attribute_printf(1, 2);
/*
* errcontext() is typically called in error context callback functions, not
@@ -184,22 +184,22 @@ extern void errhint(const char *fmt,...) pg_attribute_printf(1, 2);
*/
#define errcontext set_errcontext_domain(TEXTDOMAIN), errcontext_msg
-extern void set_errcontext_domain(const char *domain);
+extern int set_errcontext_domain(const char *domain);
-extern void errcontext_msg(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errcontext_msg(const char *fmt,...) pg_attribute_printf(1, 2);
-extern void errhidestmt(bool hide_stmt);
-extern void errhidecontext(bool hide_ctx);
+extern int errhidestmt(bool hide_stmt);
+extern int errhidecontext(bool hide_ctx);
-extern void errbacktrace(void);
+extern int errbacktrace(void);
-extern void errfunction(const char *funcname);
-extern void errposition(int cursorpos);
+extern int errfunction(const char *funcname);
+extern int errposition(int cursorpos);
-extern void internalerrposition(int cursorpos);
-extern void internalerrquery(const char *query);
+extern int internalerrposition(int cursorpos);
+extern int internalerrquery(const char *query);
-extern void err_generic_string(int field, const char *str);
+extern int err_generic_string(int field, const char *str);
extern int geterrcode(void);
extern int geterrposition(void);