]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Fix various compiler warnings
authorArne Schwabe <arne@rfc2549.org>
Sat, 19 Nov 2016 15:42:44 +0000 (16:42 +0100)
committerGert Doering <gert@greenie.muc.de>
Sat, 19 Nov 2016 19:04:38 +0000 (20:04 +0100)
- 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>
src/openvpn/push.c
src/openvpn/push.h

index f86bdd37613c494cdb2ffbbd3bcbf343365bbad7..b7539e6def93839ec9a229442e3174e13ee3b7d6 100644 (file)
 
 static char push_reply_cmd[] = "PUSH_REPLY";
 
-/**
- * Add an option to the given push list by providing a format string.
- *
- * The string added to the push options is allocated in o->gc, so the caller
- * does not have to preserve anything.
- *
- * @param gc        GC arena where options are allocated
- * @param push_list Push list containing options
- * @param msglevel  The message level to use when printing errors
- * @param fmt       Format string for the option
- * @param ...       Format string arguments
- *
- * @return true on success, false on failure.
- */
-static bool push_option_fmt(struct gc_arena *gc, struct push_list *push_list,
-                           int msglevel, const char *fmt, ...)
-#ifdef __GNUC__
-#if __USE_MINGW_ANSI_STDIO
-    __attribute__ ((format (gnu_printf, 4, 5)))
-#else
-    __attribute__ ((format (__printf__, 4, 5)))
-#endif
-#endif
-    ;
-
 /*
  * Auth username/password
  *
@@ -177,6 +152,30 @@ server_pushed_signal (struct context *c, const struct buffer *buffer, const bool
 }
 
 #if P2MP_SERVER
+/**
+ * Add an option to the given push list by providing a format string.
+ *
+ * The string added to the push options is allocated in o->gc, so the caller
+ * does not have to preserve anything.
+ *
+ * @param gc        GC arena where options are allocated
+ * @param push_list Push list containing options
+ * @param msglevel  The message level to use when printing errors
+ * @param fmt       Format string for the option
+ * @param ...       Format string arguments
+ *
+ * @return true on success, false on failure.
+ */
+static bool push_option_fmt(struct gc_arena *gc, struct push_list *push_list,
+                           int msglevel, const char *fmt, ...)
+#ifdef __GNUC__
+#if __USE_MINGW_ANSI_STDIO
+    __attribute__ ((format (gnu_printf, 4, 5)))
+#else
+    __attribute__ ((format (__printf__, 4, 5)))
+#endif
+#endif
+    ;
 
 /*
  * Send auth failed message from server to client.
index d6cb4b1e0e8ab6e8e82d08f7ee8095076664df1c..1dfd80e5b2b9d7962b568e61f5ba775f1b5e9ae7 100644 (file)
@@ -51,10 +51,9 @@ void receive_auth_failed (struct context *c, const struct buffer *buffer);
 
 void server_pushed_signal (struct context *c, const struct buffer *buffer, const bool restart, const int adv);
 
-#if P2MP_SERVER
-
 void incoming_push_message (struct context *c, const struct buffer *buffer);
 
+#if P2MP_SERVER
 void clone_push_list (struct options *o);
 
 void push_option (struct options *o, const char *opt, int msglevel);