diff options
| author | Peter Eisentraut | 2014-04-18 04:03:19 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2014-04-18 04:03:19 +0000 |
| commit | e7128e8dbb305059c30ec085461297e619bcbff4 (patch) | |
| tree | ed4bf968847b30a098d113bb787adc2b97c687e0 /contrib/tsearch2/tsearch2.c | |
| parent | 01563158235f5650743fd9b1dfa80c3d8faf89bb (diff) | |
Create function prototype as part of PG_FUNCTION_INFO_V1 macro
Because of gcc -Wmissing-prototypes, all functions in dynamically
loadable modules must have a separate prototype declaration. This is
meant to detect global functions that are not declared in header files,
but in cases where the function is called via dfmgr, this is redundant.
Besides filling up space with boilerplate, this is a frequent source of
compiler warnings in extension modules.
We can fix that by creating the function prototype as part of the
PG_FUNCTION_INFO_V1 macro, which such modules have to use anyway. That
makes the code of modules cleaner, because there is one less place where
the entry points have to be listed, and creates an additional check that
functions have the right prototype.
Remove now redundant prototypes from contrib and other modules.
Diffstat (limited to 'contrib/tsearch2/tsearch2.c')
| -rw-r--r-- | contrib/tsearch2/tsearch2.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/contrib/tsearch2/tsearch2.c b/contrib/tsearch2/tsearch2.c index e508b43bc43..bd30d875158 100644 --- a/contrib/tsearch2/tsearch2.c +++ b/contrib/tsearch2/tsearch2.c @@ -45,7 +45,7 @@ static Oid current_parser_oid = InvalidOid; CStringGetDatum(text_to_cstring(text)))) #define UNSUPPORTED_FUNCTION(name) \ - Datum name(PG_FUNCTION_ARGS); \ + PG_FUNCTION_INFO_V1(name); \ Datum \ name(PG_FUNCTION_ARGS) \ { \ @@ -57,30 +57,11 @@ static Oid current_parser_oid = InvalidOid; /* keep compiler quiet */ \ PG_RETURN_NULL(); \ } \ - PG_FUNCTION_INFO_V1(name) + extern int no_such_variable static Oid GetCurrentDict(void); static Oid GetCurrentParser(void); -Datum tsa_lexize_byname(PG_FUNCTION_ARGS); -Datum tsa_lexize_bycurrent(PG_FUNCTION_ARGS); -Datum tsa_set_curdict(PG_FUNCTION_ARGS); -Datum tsa_set_curdict_byname(PG_FUNCTION_ARGS); -Datum tsa_token_type_current(PG_FUNCTION_ARGS); -Datum tsa_set_curprs(PG_FUNCTION_ARGS); -Datum tsa_set_curprs_byname(PG_FUNCTION_ARGS); -Datum tsa_parse_current(PG_FUNCTION_ARGS); -Datum tsa_set_curcfg(PG_FUNCTION_ARGS); -Datum tsa_set_curcfg_byname(PG_FUNCTION_ARGS); -Datum tsa_to_tsvector_name(PG_FUNCTION_ARGS); -Datum tsa_to_tsquery_name(PG_FUNCTION_ARGS); -Datum tsa_plainto_tsquery_name(PG_FUNCTION_ARGS); -Datum tsa_headline_byname(PG_FUNCTION_ARGS); -Datum tsa_ts_stat(PG_FUNCTION_ARGS); -Datum tsa_tsearch2(PG_FUNCTION_ARGS); -Datum tsa_rewrite_accum(PG_FUNCTION_ARGS); -Datum tsa_rewrite_finish(PG_FUNCTION_ARGS); - PG_FUNCTION_INFO_V1(tsa_lexize_byname); PG_FUNCTION_INFO_V1(tsa_lexize_bycurrent); PG_FUNCTION_INFO_V1(tsa_set_curdict); |
