summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <justus@gnupg.org>2016-09-26 14:27:54 +0200
committerOlly Betts <olly@survex.com>2022-02-03 17:25:44 +1300
commit5691f3f685e0bfc8d5749387bca5815c8e69de27 (patch)
tree9f37a860a109fc56f7d278962d78f03cd54328a6
parent0cdbbf326be2484c08076c0b496da39576e6c146 (diff)
downloadswig-5691f3f685e0bfc8d5749387bca5815c8e69de27.tar.gz
Fix function prototypes of generated pointer functions
Previously, the emitted constructors were incomplete prototypes. When compiling the wrapper code using gcc 6 and -Wstrict-prototypes, the following warnings were emitted: warning: function declaration isn’t a prototype [-Wstrict-prototypes] See #801
-rw-r--r--Lib/cpointer.i4
-rw-r--r--Lib/typemaps/cpointer.swg4
2 files changed, 4 insertions, 4 deletions
diff --git a/Lib/cpointer.i b/Lib/cpointer.i
index a04de3d67..df40c0426 100644
--- a/Lib/cpointer.i
+++ b/Lib/cpointer.i
@@ -120,7 +120,7 @@ static NAME * frompointer(TYPE *t) {
%define %pointer_functions(TYPE,NAME)
%{
-static TYPE *new_##NAME() { %}
+static TYPE *new_##NAME(void) { %}
#ifdef __cplusplus
%{ return new TYPE(); %}
#else
@@ -155,7 +155,7 @@ static TYPE NAME ##_value(TYPE *obj) {
}
%}
-TYPE *new_##NAME();
+TYPE *new_##NAME(void);
TYPE *copy_##NAME(TYPE value);
void delete_##NAME(TYPE *obj);
void NAME##_assign(TYPE *obj, TYPE value);
diff --git a/Lib/typemaps/cpointer.swg b/Lib/typemaps/cpointer.swg
index 88e8ef242..a5ac07d85 100644
--- a/Lib/typemaps/cpointer.swg
+++ b/Lib/typemaps/cpointer.swg
@@ -105,7 +105,7 @@ typedef struct {
%define %pointer_functions(TYPE,NAME)
%{
- static TYPE *new_##NAME() {
+ static TYPE *new_##NAME(void) {
return %new_instance(TYPE);
}
@@ -126,7 +126,7 @@ typedef struct {
}
%}
-TYPE *new_##NAME();
+TYPE *new_##NAME(void);
TYPE *copy_##NAME(TYPE value);
void delete_##NAME(TYPE *obj);
void NAME##_assign(TYPE *obj, TYPE value);