Browse code

Fix various compiler warnings

- move p2mp only push_option_fmt to p2mp only section to avoid warning
that struct push_list being defined in the argument list
- incoming_push_message not declared on client without server by putting
it into the right define block

Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1479570164-23522-1-git-send-email-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg13124.html

Signed-off-by: Gert Doering <gert@greenie.muc.de>

Arne Schwabe authored on 2016/11/20 00:42:44
Showing 2 changed files
... ...
@@ -42,31 +42,6 @@
42 42
 
43 43
 static char push_reply_cmd[] = "PUSH_REPLY";
44 44
 
45
-/**
46
- * Add an option to the given push list by providing a format string.
47
- *
48
- * The string added to the push options is allocated in o->gc, so the caller
49
- * does not have to preserve anything.
50
- *
51
- * @param gc        GC arena where options are allocated
52
- * @param push_list Push list containing options
53
- * @param msglevel  The message level to use when printing errors
54
- * @param fmt       Format string for the option
55
- * @param ...       Format string arguments
56
- *
57
- * @return true on success, false on failure.
58
- */
59
-static bool push_option_fmt(struct gc_arena *gc, struct push_list *push_list,
60
-			    int msglevel, const char *fmt, ...)
61
-#ifdef __GNUC__
62
-#if __USE_MINGW_ANSI_STDIO
63
-    __attribute__ ((format (gnu_printf, 4, 5)))
64
-#else
65
-    __attribute__ ((format (__printf__, 4, 5)))
66
-#endif
67
-#endif
68
-    ;
69
-
70 45
 /*
71 46
  * Auth username/password
72 47
  *
... ...
@@ -177,6 +152,30 @@ server_pushed_signal (struct context *c, const struct buffer *buffer, const bool
177 177
 }
178 178
 
179 179
 #if P2MP_SERVER
180
+/**
181
+ * Add an option to the given push list by providing a format string.
182
+ *
183
+ * The string added to the push options is allocated in o->gc, so the caller
184
+ * does not have to preserve anything.
185
+ *
186
+ * @param gc        GC arena where options are allocated
187
+ * @param push_list Push list containing options
188
+ * @param msglevel  The message level to use when printing errors
189
+ * @param fmt       Format string for the option
190
+ * @param ...       Format string arguments
191
+ *
192
+ * @return true on success, false on failure.
193
+ */
194
+static bool push_option_fmt(struct gc_arena *gc, struct push_list *push_list,
195
+			    int msglevel, const char *fmt, ...)
196
+#ifdef __GNUC__
197
+#if __USE_MINGW_ANSI_STDIO
198
+    __attribute__ ((format (gnu_printf, 4, 5)))
199
+#else
200
+    __attribute__ ((format (__printf__, 4, 5)))
201
+#endif
202
+#endif
203
+    ;
180 204
 
181 205
 /*
182 206
  * Send auth failed message from server to client.
... ...
@@ -51,10 +51,9 @@ void receive_auth_failed (struct context *c, const struct buffer *buffer);
51 51
 
52 52
 void server_pushed_signal (struct context *c, const struct buffer *buffer, const bool restart, const int adv);
53 53
 
54
-#if P2MP_SERVER
55
-
56 54
 void incoming_push_message (struct context *c, const struct buffer *buffer);
57 55
 
56
+#if P2MP_SERVER
58 57
 void clone_push_list (struct options *o);
59 58
 
60 59
 void push_option (struct options *o, const char *opt, int msglevel);