summaryrefslogtreecommitdiff
path: root/contrib/spi
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2014-04-18 00:03:19 -0400
committerPeter Eisentraut <peter_e@gmx.net>2014-04-18 00:03:19 -0400
commite7128e8dbb305059c30ec085461297e619bcbff4 (patch)
treeed4bf968847b30a098d113bb787adc2b97c687e0 /contrib/spi
parent01563158235f5650743fd9b1dfa80c3d8faf89bb (diff)
downloadpostgresql-e7128e8dbb305059c30ec085461297e619bcbff4.tar.gz
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/spi')
-rw-r--r--contrib/spi/autoinc.c2
-rw-r--r--contrib/spi/insert_username.c2
-rw-r--r--contrib/spi/moddatetime.c2
-rw-r--r--contrib/spi/refint.c4
-rw-r--r--contrib/spi/timetravel.c3
5 files changed, 0 insertions, 13 deletions
diff --git a/contrib/spi/autoinc.c b/contrib/spi/autoinc.c
index 54bbc4345c..41eae4fdc4 100644
--- a/contrib/spi/autoinc.c
+++ b/contrib/spi/autoinc.c
@@ -12,8 +12,6 @@
PG_MODULE_MAGIC;
-extern Datum autoinc(PG_FUNCTION_ARGS);
-
PG_FUNCTION_INFO_V1(autoinc);
Datum
diff --git a/contrib/spi/insert_username.c b/contrib/spi/insert_username.c
index 3bc51c7f02..875207881a 100644
--- a/contrib/spi/insert_username.c
+++ b/contrib/spi/insert_username.c
@@ -17,8 +17,6 @@
PG_MODULE_MAGIC;
-extern Datum insert_username(PG_FUNCTION_ARGS);
-
PG_FUNCTION_INFO_V1(insert_username);
Datum
diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c
index 2ec9654036..c6d33b7355 100644
--- a/contrib/spi/moddatetime.c
+++ b/contrib/spi/moddatetime.c
@@ -23,8 +23,6 @@ OH, me, I'm Terry Mackintosh <terry@terrym.com>
PG_MODULE_MAGIC;
-extern Datum moddatetime(PG_FUNCTION_ARGS);
-
PG_FUNCTION_INFO_V1(moddatetime);
Datum
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c
index fbed300396..2602210741 100644
--- a/contrib/spi/refint.c
+++ b/contrib/spi/refint.c
@@ -16,10 +16,6 @@
PG_MODULE_MAGIC;
-extern Datum check_primary_key(PG_FUNCTION_ARGS);
-extern Datum check_foreign_key(PG_FUNCTION_ARGS);
-
-
typedef struct
{
char *ident;
diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c
index fa74daba94..a97eaa148f 100644
--- a/contrib/spi/timetravel.c
+++ b/contrib/spi/timetravel.c
@@ -22,9 +22,6 @@
PG_MODULE_MAGIC;
/* AbsoluteTime currabstime(void); */
-Datum timetravel(PG_FUNCTION_ARGS);
-Datum set_timetravel(PG_FUNCTION_ARGS);
-Datum get_timetravel(PG_FUNCTION_ARGS);
typedef struct
{