diff options
| author | Tom Lane | 2020-03-25 15:57:36 +0000 |
|---|---|---|
| committer | Tom Lane | 2020-03-25 15:57:36 +0000 |
| commit | bda6dedbea599209048bc51115ecb2062ceb976c (patch) | |
| tree | 978a9e7efd646601f82780c6dcd41eb274f29acc /src/include/parser | |
| parent | f5817595a7f194d25bc9be5b035eb1f7f60cd1fa (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/parser')
| -rw-r--r-- | src/include/parser/parse_coerce.h | 2 | ||||
| -rw-r--r-- | src/include/parser/parse_node.h | 2 | ||||
| -rw-r--r-- | src/include/parser/scanner.h | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/include/parser/parse_coerce.h b/src/include/parser/parse_coerce.h index a3295b3fa4..8686eaacbc 100644 --- a/src/include/parser/parse_coerce.h +++ b/src/include/parser/parse_coerce.h @@ -61,7 +61,7 @@ extern Node *coerce_to_specific_type_typmod(ParseState *pstate, Node *node, Oid targetTypeId, int32 targetTypmod, const char *constructName); -extern void parser_coercion_errposition(ParseState *pstate, +extern int parser_coercion_errposition(ParseState *pstate, int coerce_location, Node *input_expr); diff --git a/src/include/parser/parse_node.h b/src/include/parser/parse_node.h index b223b59542..d25819aa28 100644 --- a/src/include/parser/parse_node.h +++ b/src/include/parser/parse_node.h @@ -307,7 +307,7 @@ typedef struct ParseCallbackState extern ParseState *make_parsestate(ParseState *parentParseState); extern void free_parsestate(ParseState *pstate); -extern void parser_errposition(ParseState *pstate, int location); +extern int parser_errposition(ParseState *pstate, int location); extern void setup_parser_errposition_callback(ParseCallbackState *pcbstate, ParseState *pstate, int location); diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h index 02ae10a225..a27352afc1 100644 --- a/src/include/parser/scanner.h +++ b/src/include/parser/scanner.h @@ -140,7 +140,7 @@ extern core_yyscan_t scanner_init(const char *str, extern void scanner_finish(core_yyscan_t yyscanner); extern int core_yylex(core_YYSTYPE *lvalp, YYLTYPE *llocp, core_yyscan_t yyscanner); -extern void scanner_errposition(int location, core_yyscan_t yyscanner); +extern int scanner_errposition(int location, core_yyscan_t yyscanner); extern void setup_scanner_errposition_callback(ScannerCallbackState *scbstate, core_yyscan_t yyscanner, int location); |
