gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] branch master updated (27c939ad -> 3f5fe81d


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (27c939ad -> 3f5fe81d)
Date: Fri, 29 Sep 2017 22:06:02 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 27c939ad mhd_str.c: muted compiler warning
     new 3ddb4e56 digestauth.c: refined comment
     new 527700a0 Added ability to compile demos without libmagic, added more 
accurate check for libmagic in configure.
     new a5b63e99 Muted compiler warnings in examples.
     new 3f5fe81d Fixed compiler warnings for tests in src/microhttpd

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 configure.ac                                      | 36 +++++++++++++++++++----
 doc/examples/basicauthentication.c                |  7 ++++-
 doc/examples/hellobrowser.c                       | 11 +++++--
 doc/examples/largepost.c                          | 11 +++++++
 doc/examples/logging.c                            |  7 +++++
 doc/examples/responseheaders.c                    |  6 ++++
 doc/examples/sessions.c                           | 11 +++++++
 doc/examples/simplepost.c                         | 12 ++++++++
 doc/examples/tlsauthentication.c                  | 10 +++++--
 src/examples/Makefile.am                          | 12 +++++---
 src/examples/authorization_example.c              |  4 +++
 src/examples/benchmark.c                          | 12 ++++++++
 src/examples/benchmark_https.c                    | 12 ++++++++
 src/examples/chunked_example.c                    |  5 ++++
 src/examples/demo.c                               | 27 +++++++++++++++--
 src/examples/demo_https.c                         | 27 +++++++++++++++--
 src/examples/digest_auth_example.c                |  7 +++++
 src/examples/dual_stack_example.c                 |  4 +++
 src/examples/fileserver_example.c                 |  4 +++
 src/examples/fileserver_example_dirs.c            |  5 ++++
 src/examples/fileserver_example_external_select.c |  4 +++
 src/examples/https_fileserver_example.c           |  4 +++
 src/examples/minimal_example.c                    | 12 +++++---
 src/examples/minimal_example_comet.c              |  7 +++++
 src/examples/post_example.c                       | 13 ++++++++
 src/examples/querystring_example.c                |  4 +++
 src/examples/refuse_post_example.c                |  5 ++++
 src/examples/timeout.c                            | 10 +++++--
 src/examples/upgrade_example.c                    |  8 +++++
 src/microhttpd/digestauth.c                       |  2 +-
 src/microhttpd/test_daemon.c                      |  9 ++++++
 src/microhttpd/test_http_reasons.c                |  2 ++
 src/microhttpd/test_postprocessor.c               | 31 ++++++++++---------
 src/microhttpd/test_postprocessor_amp.c           |  3 ++
 src/microhttpd/test_postprocessor_large.c         |  7 +++--
 src/microhttpd/test_shutdown_select.c             |  1 +
 src/microhttpd/test_str_token.c                   |  1 +
 src/microhttpd/test_upgrade.c                     |  8 +++++
 38 files changed, 319 insertions(+), 42 deletions(-)

diff --git a/configure.ac b/configure.ac
index a5a48210..85da74cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1195,12 +1195,36 @@ then
 fi
 AM_CONDITIONAL([HAVE_CURL], [test "x$enable_curl" = "xyes"])
 
-mhd_have_magic_open='no'
-AC_CHECK_HEADERS([magic.h],
-  [ AC_CHECK_LIB([[magic]], [[magic_open]], [[mhd_have_magic_open='yes']]) 
],[],
-  [AC_INCLUDES_DEFAULT])
-
-AM_CONDITIONAL([HAVE_MAGIC], [[test "x$mhd_have_magic_open" = "xyes"]])
+mhd_have_libmagic="no"
+SAVE_LIBS="$LIBS"
+LIBS="$LIBS -lmagic"
+AC_MSG_CHECKING([[for suitable libmagic]])
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM(
+    [[
+#include <magic.h>
+    ]],
+    [[
+      char var_data[256];
+      const char *var_mime;
+      magic_t var_magic = magic_open (MAGIC_MIME_TYPE);
+      (void)magic_load (var_magic, NULL);
+      var_data[0] = 0;
+      var_mime = magic_buffer (var_magic, var_data, 1);
+      magic_close (var_magic);
+    ]]
+   )
+  ],
+  [
+    AC_DEFINE([HAVE_LIBMAGIC], [1], [Define to 1 if you have suitable 
libmagic.])
+    mhd_have_libmagic="yes"
+    AC_MSG_RESULT([[yes]])
+  ],
+  [AC_MSG_RESULT([[no]])
+  ]
+)
+LIBS="$SAVE_LIBS"
+AM_CONDITIONAL([HAVE_LIBMAGIC], [[test "x$mhd_have_libmagic" = "xyes"]])
 
 # large file support (> 4 GB)
 AC_SYS_LARGEFILE
diff --git a/doc/examples/basicauthentication.c 
b/doc/examples/basicauthentication.c
index 22873d8c..0e13a2ee 100644
--- a/doc/examples/basicauthentication.c
+++ b/doc/examples/basicauthentication.c
@@ -28,6 +28,11 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
   int fail;
   int ret;
   struct MHD_Response *response;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;
@@ -67,7 +72,7 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
 
 
 int
-main ()
+main (void)
 {
   struct MHD_Daemon *daemon;
 
diff --git a/doc/examples/hellobrowser.c b/doc/examples/hellobrowser.c
index 381a51e0..dce4ee6d 100644
--- a/doc/examples/hellobrowser.c
+++ b/doc/examples/hellobrowser.c
@@ -23,7 +23,14 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
   const char *page = "<html><body>Hello, browser!</body></html>";
   struct MHD_Response *response;
   int ret;
-  
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)method;            /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
+
   response =
     MHD_create_response_from_buffer (strlen (page), (void *) page, 
                                     MHD_RESPMEM_PERSISTENT);
@@ -35,7 +42,7 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
 
 
 int
-main ()
+main (void)
 {
   struct MHD_Daemon *daemon;
 
diff --git a/doc/examples/largepost.c b/doc/examples/largepost.c
index 1edf4d50..af6a48dd 100644
--- a/doc/examples/largepost.c
+++ b/doc/examples/largepost.c
@@ -128,6 +128,10 @@ iterate_post (void *coninfo_cls,
 {
   struct connection_info_struct *con_info = coninfo_cls;
   FILE *fp;
+  (void)kind;               /* Unused. Silent compiler warning. */
+  (void)content_type;       /* Unused. Silent compiler warning. */
+  (void)transfer_encoding;  /* Unused. Silent compiler warning. */
+  (void)off;                /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (key, "file"))
     {
@@ -178,6 +182,9 @@ request_completed (void *cls,
                    enum MHD_RequestTerminationCode toe)
 {
   struct connection_info_struct *con_info = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == con_info)
     return;
@@ -209,6 +216,10 @@ answer_to_connection (void *cls,
                       size_t *upload_data_size,
                       void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+
   if (NULL == *con_cls)
     {
       /* First call, setup data structures */
diff --git a/doc/examples/logging.c b/doc/examples/logging.c
index aff21426..239fbe7d 100644
--- a/doc/examples/logging.c
+++ b/doc/examples/logging.c
@@ -18,6 +18,8 @@ static int
 print_out_key (void *cls, enum MHD_ValueKind kind, const char *key,
                const char *value)
 {
+  (void)cls;    /* Unused. Silent compiler warning. */
+  (void)kind;   /* Unused. Silent compiler warning. */
   printf ("%s: %s\n", key, value);
   return MHD_YES;
 }
@@ -29,6 +31,11 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
                       const char *version, const char *upload_data,
                       size_t *upload_data_size, void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
   printf ("New %s request for %s using version %s\n", method, url, version);
 
   MHD_get_connection_values (connection, MHD_HEADER_KIND, print_out_key,
diff --git a/doc/examples/responseheaders.c b/doc/examples/responseheaders.c
index aa5cd7e2..0f459c2e 100644
--- a/doc/examples/responseheaders.c
+++ b/doc/examples/responseheaders.c
@@ -29,6 +29,12 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
   int fd;
   int ret;
   struct stat sbuf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;
diff --git a/doc/examples/sessions.c b/doc/examples/sessions.c
index be4cf467..b5b25440 100644
--- a/doc/examples/sessions.c
+++ b/doc/examples/sessions.c
@@ -419,6 +419,8 @@ not_found_page (const void *cls,
 {
   int ret;
   struct MHD_Response *response;
+  (void)cls;     /* Unused. Silent compiler warning. */
+  (void)session; /* Unused. Silent compiler warning. */
 
   /* unsupported HTTP method */
   response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
@@ -479,6 +481,10 @@ post_iterator (void *cls,
 {
   struct Request *request = cls;
   struct Session *session = request->session;
+  (void)kind;               /* Unused. Silent compiler warning. */
+  (void)filename;           /* Unused. Silent compiler warning. */
+  (void)content_type;       /* Unused. Silent compiler warning. */
+  (void)transfer_encoding;  /* Unused. Silent compiler warning. */
 
   if (0 == strcmp ("DONE", key))
     {
@@ -565,6 +571,8 @@ create_response (void *cls,
   struct Session *session;
   int ret;
   unsigned int i;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   request = *ptr;
   if (NULL == request)
@@ -664,6 +672,9 @@ request_completed_callback (void *cls,
                            enum MHD_RequestTerminationCode toe)
 {
   struct Request *request = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == request)
     return;
diff --git a/doc/examples/simplepost.c b/doc/examples/simplepost.c
index a6c3a69d..a3bba94a 100644
--- a/doc/examples/simplepost.c
+++ b/doc/examples/simplepost.c
@@ -74,6 +74,11 @@ iterate_post (void *coninfo_cls, enum MHD_ValueKind kind, 
const char *key,
               size_t size)
 {
   struct connection_info_struct *con_info = coninfo_cls;
+  (void)kind;               /* Unused. Silent compiler warning. */
+  (void)filename;           /* Unused. Silent compiler warning. */
+  (void)content_type;       /* Unused. Silent compiler warning. */
+  (void)transfer_encoding;  /* Unused. Silent compiler warning. */
+  (void)off;                /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "name"))
     {
@@ -101,6 +106,9 @@ request_completed (void *cls, struct MHD_Connection 
*connection,
                    void **con_cls, enum MHD_RequestTerminationCode toe)
 {
   struct connection_info_struct *con_info = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == con_info)
     return;
@@ -123,6 +131,10 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
                       const char *version, const char *upload_data,
                       size_t *upload_data_size, void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+
   if (NULL == *con_cls)
     {
       struct connection_info_struct *con_info;
diff --git a/doc/examples/tlsauthentication.c b/doc/examples/tlsauthentication.c
index 742837e9..293e5e65 100644
--- a/doc/examples/tlsauthentication.c
+++ b/doc/examples/tlsauthentication.c
@@ -29,7 +29,7 @@ string_to_base64 (const char *message)
   const char *lookup =
     "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
   unsigned long l;
-  int i;
+  size_t i;
   char *tmp;
   size_t length = strlen (message);
 
@@ -107,7 +107,7 @@ load_file (const char *filename)
     }
   buffer[size] = '\0';
 
-  if (size != fread (buffer, 1, size, fp))
+  if (size != (long)fread (buffer, 1, size, fp))
     {
       free (buffer);
       buffer = NULL;
@@ -218,6 +218,12 @@ answer_to_connection (void *cls, struct MHD_Connection 
*connection,
                       const char *version, const char *upload_data,
                       size_t *upload_data_size, void **con_cls)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (method, "GET"))
     return MHD_NO;
   if (NULL == *con_cls)
diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am
index aae7ff48..58f4b4aa 100644
--- a/src/examples/Makefile.am
+++ b/src/examples/Makefile.am
@@ -38,7 +38,6 @@ endif
 if HAVE_POSTPROCESSOR
 noinst_PROGRAMS += \
   post_example
-if HAVE_MAGIC
 if HAVE_POSIX_THREADS
 noinst_PROGRAMS += demo
 if ENABLE_HTTPS
@@ -46,7 +45,6 @@ noinst_PROGRAMS += demo_https
 endif
 endif
 endif
-endif
 
 if ENABLE_DAUTH
 noinst_PROGRAMS += \
@@ -100,7 +98,10 @@ demo_CPPFLAGS = \
  $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 demo_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la  \
- $(PTHREAD_LIBS) -lmagic
+ $(PTHREAD_LIBS)
+if HAVE_LIBMAGIC
+demo_LDADD += -lmagic
+endif
 
 demo_https_SOURCES = \
  demo_https.c
@@ -110,7 +111,10 @@ demo_https_CPPFLAGS = \
  $(AM_CPPFLAGS) $(CPU_COUNT_DEF)
 demo_https_LDADD = \
  $(top_builddir)/src/microhttpd/libmicrohttpd.la  \
- $(PTHREAD_LIBS) -lmagic
+ $(PTHREAD_LIBS)
+if HAVE_LIBMAGIC
+demo_https_LDADD += -lmagic
+endif
 
 benchmark_SOURCES = \
  benchmark.c
diff --git a/src/examples/authorization_example.c 
b/src/examples/authorization_example.c
index d7931471..d62973a2 100644
--- a/src/examples/authorization_example.c
+++ b/src/examples/authorization_example.c
@@ -53,6 +53,10 @@ ahc_echo (void *cls,
   char *user;
   char *pass;
   int fail;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/benchmark.c b/src/examples/benchmark.c
index f9b8b5fd..9512b9bf 100644
--- a/src/examples/benchmark.c
+++ b/src/examples/benchmark.c
@@ -69,6 +69,9 @@ completed_callback (void *cls,
   struct timeval *tv = *con_cls;
   struct timeval tve;
   uint64_t delta;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == tv)
     return;
@@ -94,6 +97,8 @@ uri_logger_cb (void *cls,
               const char *uri)
 {
   struct timeval *tv = malloc (sizeof (struct timeval));
+  (void)cls; /* Unused. Silent compiler warning. */
+  (void)uri; /* Unused. Silent compiler warning. */
 
   if (NULL != tv)
     gettimeofday (tv, NULL);
@@ -109,6 +114,13 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data, size_t *upload_data_size, void **ptr)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)ptr;               /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   return MHD_queue_response (connection, MHD_HTTP_OK, response);
diff --git a/src/examples/benchmark_https.c b/src/examples/benchmark_https.c
index b7327afc..87a79717 100644
--- a/src/examples/benchmark_https.c
+++ b/src/examples/benchmark_https.c
@@ -69,6 +69,9 @@ completed_callback (void *cls,
   struct timeval *tv = *con_cls;
   struct timeval tve;
   uint64_t delta;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == tv)
     return;
@@ -94,6 +97,8 @@ uri_logger_cb (void *cls,
               const char *uri)
 {
   struct timeval *tv = malloc (sizeof (struct timeval));
+  (void)cls; /* Unused. Silent compiler warning. */
+  (void)uri; /* Unused. Silent compiler warning. */
 
   if (NULL != tv)
     gettimeofday (tv, NULL);
@@ -109,6 +114,13 @@ ahc_echo (void *cls,
           const char *version,
           const char *upload_data, size_t *upload_data_size, void **ptr)
 {
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)ptr;               /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
   return MHD_queue_response (connection, MHD_HTTP_OK, response);
diff --git a/src/examples/chunked_example.c b/src/examples/chunked_example.c
index 96ae148a..a661216c 100644
--- a/src/examples/chunked_example.c
+++ b/src/examples/chunked_example.c
@@ -99,6 +99,11 @@ ahc_echo (void *cls,
   struct ResponseContentCallbackParam * callback_param;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/demo.c b/src/examples/demo.c
index f6187676..edf38e98 100644
--- a/src/examples/demo.c
+++ b/src/examples/demo.c
@@ -35,7 +35,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+#ifdef MHD_HAVE_LIBMAGIC
 #include <magic.h>
+#endif /* MHD_HAVE_LIBMAGIC */
 #include <limits.h>
 #include <ctype.h>
 
@@ -52,12 +54,14 @@
  */
 #define NUMBER_OF_THREADS CPU_COUNT
 
+#ifdef MHD_HAVE_LIBMAGIC
 /**
  * How many bytes of a file do we give to libmagic to determine the mime type?
  * 16k might be a bit excessive, but ought not hurt performance much anyway,
  * and should definitively be on the safe side.
  */
 #define MAGIC_HEADER_SIZE (16 * 1024)
+#endif /* MHD_HAVE_LIBMAGIC */
 
 
 /**
@@ -183,10 +187,12 @@ static struct MHD_Response *request_refused_response;
  */
 static pthread_mutex_t mutex;
 
+#ifdef MHD_HAVE_LIBMAGIC
 /**
  * Global handle to MAGIC data.
  */
 static magic_t magic;
+#endif /* MHD_HAVE_LIBMAGIC */
 
 
 /**
@@ -486,6 +492,10 @@ process_upload_data (void *cls,
 {
   struct UploadContext *uc = cls;
   int i;
+  (void)kind;              /* Unused. Silent compiler warning. */
+  (void)content_type;      /* Unused. Silent compiler warning. */
+  (void)transfer_encoding; /* Unused. Silent compiler warning. */
+  (void)off;               /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
@@ -606,6 +616,9 @@ response_completed_callback (void *cls,
                             enum MHD_RequestTerminationCode toe)
 {
   struct UploadContext *uc = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == uc)
     return; /* this request wasn't an upload request */
@@ -682,12 +695,16 @@ generate_page (void *cls,
   int ret;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (url, "/"))
     {
       /* should be file download */
+#ifdef MHD_HAVE_LIBMAGIC
       char file_data[MAGIC_HEADER_SIZE];
       ssize_t got;
+#endif /* MHD_HAVE_LIBMAGIC */
       const char *mime;
 
       if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
@@ -710,13 +727,15 @@ generate_page (void *cls,
        return MHD_queue_response (connection,
                                   MHD_HTTP_NOT_FOUND,
                                   file_not_found_response);
+#ifdef MHD_HAVE_LIBMAGIC
       /* read beginning of the file to determine mime type  */
       got = read (fd, file_data, sizeof (file_data));
+      (void) lseek (fd, 0, SEEK_SET);
       if (-1 != got)
        mime = magic_buffer (magic, file_data, got);
       else
+#endif /* MHD_HAVE_LIBMAGIC */
        mime = NULL;
-      (void) lseek (fd, 0, SEEK_SET);
 
       if (NULL == (response = MHD_create_response_from_fd (buf.st_size,
                                                           fd)))
@@ -804,6 +823,7 @@ generate_page (void *cls,
 }
 
 
+#ifndef MINGW
 /**
  * Function called if we get a SIGPIPE. Does nothing.
  *
@@ -819,7 +839,6 @@ catcher (int sig)
 /**
  * setup handlers to ignore SIGPIPE.
  */
-#ifndef MINGW
 static void
 ignore_sigpipe ()
 {
@@ -866,8 +885,10 @@ main (int argc, char *const *argv)
 #ifndef MINGW
   ignore_sigpipe ();
 #endif
+#ifdef MHD_HAVE_LIBMAGIC
   magic = magic_open (MAGIC_MIME_TYPE);
   (void) magic_load (magic, NULL);
+#endif /* MHD_HAVE_LIBMAGIC */
 
   (void) pthread_mutex_init (&mutex, NULL);
   file_not_found_response = MHD_create_response_from_buffer (strlen 
(FILE_NOT_FOUND_PAGE),
@@ -905,7 +926,9 @@ main (int argc, char *const *argv)
   MHD_destroy_response (internal_error_response);
   update_cached_response (NULL);
   (void) pthread_mutex_destroy (&mutex);
+#ifdef MHD_HAVE_LIBMAGIC
   magic_close (magic);
+#endif /* MHD_HAVE_LIBMAGIC */
   return 0;
 }
 
diff --git a/src/examples/demo_https.c b/src/examples/demo_https.c
index 51574fd7..85c369b6 100644
--- a/src/examples/demo_https.c
+++ b/src/examples/demo_https.c
@@ -36,7 +36,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <dirent.h>
+#ifdef MHD_HAVE_LIBMAGIC
 #include <magic.h>
+#endif /* MHD_HAVE_LIBMAGIC */
 #include <limits.h>
 #include <ctype.h>
 
@@ -53,12 +55,14 @@
  */
 #define NUMBER_OF_THREADS CPU_COUNT
 
+#ifdef MHD_HAVE_LIBMAGIC
 /**
  * How many bytes of a file do we give to libmagic to determine the mime type?
  * 16k might be a bit excessive, but ought not hurt performance much anyway,
  * and should definitively be on the safe side.
  */
 #define MAGIC_HEADER_SIZE (16 * 1024)
+#endif /* MHD_HAVE_LIBMAGIC */
 
 
 /**
@@ -184,10 +188,12 @@ static struct MHD_Response *request_refused_response;
  */
 static pthread_mutex_t mutex;
 
+#ifdef MHD_HAVE_LIBMAGIC
 /**
  * Global handle to MAGIC data.
  */
 static magic_t magic;
+#endif /* MHD_HAVE_LIBMAGIC */
 
 
 /**
@@ -487,6 +493,10 @@ process_upload_data (void *cls,
 {
   struct UploadContext *uc = cls;
   int i;
+  (void)kind;              /* Unused. Silent compiler warning. */
+  (void)content_type;      /* Unused. Silent compiler warning. */
+  (void)transfer_encoding; /* Unused. Silent compiler warning. */
+  (void)off;               /* Unused. Silent compiler warning. */
 
   if (0 == strcmp (key, "category"))
     return do_append (&uc->category, data, size);
@@ -607,6 +617,9 @@ response_completed_callback (void *cls,
                             enum MHD_RequestTerminationCode toe)
 {
   struct UploadContext *uc = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == uc)
     return; /* this request wasn't an upload request */
@@ -683,12 +696,16 @@ generate_page (void *cls,
   int ret;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (url, "/"))
     {
       /* should be file download */
+#ifdef MHD_HAVE_LIBMAGIC
       char file_data[MAGIC_HEADER_SIZE];
       ssize_t got;
+#endif /* MHD_HAVE_LIBMAGIC */
       const char *mime;
 
       if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
@@ -710,13 +727,15 @@ generate_page (void *cls,
        return MHD_queue_response (connection,
                                   MHD_HTTP_NOT_FOUND,
                                   file_not_found_response);
+#ifdef MHD_HAVE_LIBMAGIC
       /* read beginning of the file to determine mime type  */
       got = read (fd, file_data, sizeof (file_data));
+      (void) lseek (fd, 0, SEEK_SET);
       if (-1 != got)
        mime = magic_buffer (magic, file_data, got);
       else
+#endif /* MHD_HAVE_LIBMAGIC */
        mime = NULL;
-      (void) lseek (fd, 0, SEEK_SET);
 
       if (NULL == (response = MHD_create_response_from_fd (buf.st_size,
                                                           fd)))
@@ -803,6 +822,7 @@ generate_page (void *cls,
 }
 
 
+#ifndef MINGW
 /**
  * Function called if we get a SIGPIPE. Does nothing.
  *
@@ -818,7 +838,6 @@ catcher (int sig)
 /**
  * setup handlers to ignore SIGPIPE.
  */
-#ifndef MINGW
 static void
 ignore_sigpipe ()
 {
@@ -915,8 +934,10 @@ main (int argc, char *const *argv)
   #ifndef MINGW
   ignore_sigpipe ();
   #endif
+#ifdef MHD_HAVE_LIBMAGIC
   magic = magic_open (MAGIC_MIME_TYPE);
   (void) magic_load (magic, NULL);
+#endif /* MHD_HAVE_LIBMAGIC */
 
   (void) pthread_mutex_init (&mutex, NULL);
   file_not_found_response = MHD_create_response_from_buffer (strlen 
(FILE_NOT_FOUND_PAGE),
@@ -956,7 +977,9 @@ main (int argc, char *const *argv)
   MHD_destroy_response (internal_error_response);
   update_cached_response (NULL);
   (void) pthread_mutex_destroy (&mutex);
+#ifdef MHD_HAVE_LIBMAGIC
   magic_close (magic);
+#endif /* MHD_HAVE_LIBMAGIC */
   return 0;
 }
 
diff --git a/src/examples/digest_auth_example.c 
b/src/examples/digest_auth_example.c
index 548d0d96..4b00669f 100644
--- a/src/examples/digest_auth_example.c
+++ b/src/examples/digest_auth_example.c
@@ -45,6 +45,13 @@ ahc_echo (void *cls,
   const char *password = "testpass";
   const char *realm = "address@hidden";
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)method;            /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)ptr;               /* Unused. Silent compiler warning. */
 
   username = MHD_digest_auth_get_username(connection);
   if (username == NULL)
diff --git a/src/examples/dual_stack_example.c 
b/src/examples/dual_stack_example.c
index 6b3cef83..31b25438 100644
--- a/src/examples/dual_stack_example.c
+++ b/src/examples/dual_stack_example.c
@@ -39,6 +39,10 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/fileserver_example.c 
b/src/examples/fileserver_example.c
index 692e1f34..b8935fa1 100644
--- a/src/examples/fileserver_example.c
+++ b/src/examples/fileserver_example.c
@@ -54,6 +54,10 @@ ahc_echo (void *cls,
   int ret;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if ( (0 != strcmp (method, MHD_HTTP_METHOD_GET)) &&
        (0 != strcmp (method, MHD_HTTP_METHOD_HEAD)) )
diff --git a/src/examples/fileserver_example_dirs.c 
b/src/examples/fileserver_example_dirs.c
index 32110aa3..8c37f219 100644
--- a/src/examples/fileserver_example_dirs.c
+++ b/src/examples/fileserver_example_dirs.c
@@ -66,6 +66,7 @@ dir_reader (void *cls, uint64_t pos, char *buf, size_t max)
 
   if (max < 512)
     return 0;
+  (void)pos; /* 'pos' is ignored as function return next one single entry per 
call. */
   do
     {
       e = readdir (dir);
@@ -96,6 +97,10 @@ ahc_echo (void *cls,
   DIR *dir;
   struct stat buf;
   char emsg[1024];
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/fileserver_example_external_select.c 
b/src/examples/fileserver_example_external_select.c
index 1ae79e16..6aea6dbf 100644
--- a/src/examples/fileserver_example_external_select.c
+++ b/src/examples/fileserver_example_external_select.c
@@ -62,6 +62,10 @@ ahc_echo (void *cls,
   FILE *file;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/https_fileserver_example.c 
b/src/examples/https_fileserver_example.c
index b22b37d8..453ca2ff 100644
--- a/src/examples/https_fileserver_example.c
+++ b/src/examples/https_fileserver_example.c
@@ -129,6 +129,10 @@ http_ahc (void *cls,
   FILE *file;
   int fd;
   struct stat buf;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, MHD_HTTP_METHOD_GET))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/minimal_example.c b/src/examples/minimal_example.c
index 98e7e192..4cf6401a 100644
--- a/src/examples/minimal_example.c
+++ b/src/examples/minimal_example.c
@@ -39,6 +39,10 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
@@ -67,11 +71,11 @@ main (int argc, char *const *argv)
       printf ("%s PORT\n", argv[0]);
       return 1;
     }
-  d = MHD_start_daemon (// MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+  d = MHD_start_daemon (/* MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG, */
                         MHD_USE_AUTO | MHD_USE_INTERNAL_POLLING_THREAD | 
MHD_USE_ERROR_LOG,
-                        // MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 
| MHD_USE_POLL,
-                       // MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL,
-                       // MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG,
+                        /* MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG 
| MHD_USE_POLL, */
+                       /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG | MHD_USE_POLL, */
+                       /* MHD_USE_THREAD_PER_CONNECTION | 
MHD_USE_INTERNAL_POLLING_THREAD | MHD_USE_ERROR_LOG, */
                         atoi (argv[1]),
                         NULL, NULL, &ahc_echo, PAGE,
                        MHD_OPTION_CONNECTION_TIMEOUT, (unsigned int) 120,
diff --git a/src/examples/minimal_example_comet.c 
b/src/examples/minimal_example_comet.c
index d689212c..c4a3395d 100644
--- a/src/examples/minimal_example_comet.c
+++ b/src/examples/minimal_example_comet.c
@@ -28,6 +28,8 @@
 static ssize_t
 data_generator (void *cls, uint64_t pos, char *buf, size_t max)
 {
+  (void)cls; /* Unused. Silent compiler warning. */
+  (void)pos; /* Unused. Silent compiler warning. */
   if (max < 80)
     return 0;
   memset (buf, 'A', max - 1);
@@ -46,6 +48,11 @@ ahc_echo (void *cls,
   static int aptr;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/post_example.c b/src/examples/post_example.c
index 2d83e0a4..8b92956d 100644
--- a/src/examples/post_example.c
+++ b/src/examples/post_example.c
@@ -315,6 +315,7 @@ fill_v1_form (const void *cls,
   int ret;
   char *reply;
   struct MHD_Response *response;
+  (void)cls; /* Unused. Silent compiler warning. */
 
   reply = malloc (strlen (MAIN_PAGE) + strlen (session->value_1) + 1);
   if (NULL == reply)
@@ -358,6 +359,7 @@ fill_v1_v2_form (const void *cls,
   int ret;
   char *reply;
   struct MHD_Response *response;
+  (void)cls; /* Unused. Silent compiler warning. */
 
   reply = malloc (strlen (SECOND_PAGE) + strlen (session->value_1) + strlen 
(session->value_2) + 1);
   if (NULL == reply)
@@ -401,6 +403,8 @@ not_found_page (const void *cls,
 {
   int ret;
   struct MHD_Response *response;
+  (void)cls;     /* Unused. Silent compiler warning. */
+  (void)session; /* Unused. Silent compiler warning. */
 
   /* unsupported HTTP method */
   response = MHD_create_response_from_buffer (strlen (NOT_FOUND_ERROR),
@@ -463,6 +467,10 @@ post_iterator (void *cls,
 {
   struct Request *request = cls;
   struct Session *session = request->session;
+  (void)kind;              /* Unused. Silent compiler warning. */
+  (void)filename;          /* Unused. Silent compiler warning. */
+  (void)content_type;      /* Unused. Silent compiler warning. */
+  (void)transfer_encoding; /* Unused. Silent compiler warning. */
 
   if (0 == strcmp ("DONE", key))
     {
@@ -548,6 +556,8 @@ create_response (void *cls,
   struct Session *session;
   int ret;
   unsigned int i;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
 
   request = *ptr;
   if (NULL == request)
@@ -647,6 +657,9 @@ request_completed_callback (void *cls,
                            enum MHD_RequestTerminationCode toe)
 {
   struct Request *request = *con_cls;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)toe;         /* Unused. Silent compiler warning. */
 
   if (NULL == request)
     return;
diff --git a/src/examples/querystring_example.c 
b/src/examples/querystring_example.c
index 6f95b44e..3d91bcea 100644
--- a/src/examples/querystring_example.c
+++ b/src/examples/querystring_example.c
@@ -42,6 +42,10 @@ ahc_echo (void *cls,
   char *me;
   struct MHD_Response *response;
   int ret;
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/refuse_post_example.c 
b/src/examples/refuse_post_example.c
index 8079f467..dad3beb1 100644
--- a/src/examples/refuse_post_example.c
+++ b/src/examples/refuse_post_example.c
@@ -45,6 +45,11 @@ ahc_echo (void *cls,
   const char *me = cls;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if ((0 != strcmp (method, "GET")) && (0 != strcmp (method, "POST")))
     return MHD_NO;              /* unexpected method */
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
index e0e33560..b9569547 100644
--- a/src/examples/timeout.c
+++ b/src/examples/timeout.c
@@ -42,6 +42,13 @@ answer_to_connection(void *cls,
   const char *page = "<html><body>Hello timeout!</body></html>";
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)method;            /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
+  (void)con_cls;           /* Unused. Silent compiler warning. */
 
   response = MHD_create_response_from_buffer (strlen(page),
                                               (void *) page,
@@ -58,8 +65,7 @@ answer_to_connection(void *cls,
 
 
 int
-main (int argc,
-      char **argv)
+main (void)
 {
   struct MHD_Daemon *daemon;
 
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c
index af081408..73cfafb2 100644
--- a/src/examples/upgrade_example.c
+++ b/src/examples/upgrade_example.c
@@ -202,6 +202,9 @@ uh_cb (void *cls,
 {
   struct MyData *md;
   pthread_t pt;
+  (void)cls;         /* Unused. Silent compiler warning. */
+  (void)connection;  /* Unused. Silent compiler warning. */
+  (void)con_cls;     /* Unused. Silent compiler warning. */
 
   md = malloc (sizeof (struct MyData));
   if (NULL == md)
@@ -249,6 +252,11 @@ ahc_echo (void *cls,
   static int aptr;
   struct MHD_Response *response;
   int ret;
+  (void)cls;               /* Unused. Silent compiler warning. */
+  (void)url;               /* Unused. Silent compiler warning. */
+  (void)version;           /* Unused. Silent compiler warning. */
+  (void)upload_data;       /* Unused. Silent compiler warning. */
+  (void)upload_data_size;  /* Unused. Silent compiler warning. */
 
   if (0 != strcmp (method, "GET"))
     return MHD_NO;              /* unexpected method */
diff --git a/src/microhttpd/digestauth.c b/src/microhttpd/digestauth.c
index dc277249..ace3cdc2 100644
--- a/src/microhttpd/digestauth.c
+++ b/src/microhttpd/digestauth.c
@@ -190,7 +190,7 @@ digest_calc_response (const char ha1[HASH_MD5_HEX_LEN + 1],
   unsigned char ha2[MD5_DIGEST_SIZE];
   unsigned char resphash[MD5_DIGEST_SIZE];
   char ha2hex[HASH_MD5_HEX_LEN + 1];
-  (void)hentity; /* Silent compiler warning. */
+  (void)hentity; /* Unused. Silent compiler warning. */
 
   MD5Init (&md5);
   MD5Update (&md5,
diff --git a/src/microhttpd/test_daemon.c b/src/microhttpd/test_daemon.c
index f22ca138..e3b72bcd 100644
--- a/src/microhttpd/test_daemon.c
+++ b/src/microhttpd/test_daemon.c
@@ -57,6 +57,8 @@ apc_nothing (void *cls,
              const struct sockaddr *addr,
              socklen_t addrlen)
 {
+  (void)cls; (void)addr; (void)addrlen; /* Unused. Silent compiler warning. */
+
   return MHD_NO;
 }
 
@@ -66,6 +68,8 @@ apc_all (void *cls,
          const struct sockaddr *addr,
          socklen_t addrlen)
 {
+  (void)cls; (void)addr; (void)addrlen; /* Unused. Silent compiler warning. */
+
   return MHD_YES;
 }
 
@@ -79,6 +83,10 @@ ahc_nothing (void *cls,
              const char *upload_data, size_t *upload_data_size,
              void **unused)
 {
+  (void)cls;(void)connection;(void)url;          /* Unused. Silent compiler 
warning. */
+  (void)method;(void)version;(void)upload_data;  /* Unused. Silent compiler 
warning. */
+  (void)upload_data_size;(void)unused;           /* Unused. Silent compiler 
warning. */
+
   return MHD_NO;
 }
 
@@ -215,6 +223,7 @@ main (int argc,
       char *const *argv)
 {
   int errorCount = 0;
+  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
 
   errorCount += testStartError ();
   errorCount += testStartStop ();
diff --git a/src/microhttpd/test_http_reasons.c 
b/src/microhttpd/test_http_reasons.c
index 1a78e2c6..a4dab63a 100644
--- a/src/microhttpd/test_http_reasons.c
+++ b/src/microhttpd/test_http_reasons.c
@@ -121,6 +121,8 @@ static int test_5xx(void)
 int main(int argc, char * argv[])
 {
   int errcount = 0;
+  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
+
   errcount += test_absent_codes();
   errcount += test_1xx();
   errcount += test_2xx();
diff --git a/src/microhttpd/test_postprocessor.c 
b/src/microhttpd/test_postprocessor.c
index 029600a2..8edc5b22 100644
--- a/src/microhttpd/test_postprocessor.c
+++ b/src/microhttpd/test_postprocessor.c
@@ -91,6 +91,8 @@ value_checker (void *cls,
 {
   int *want_off = cls;
   int idx = *want_off;
+  (void)kind;  /* Unused. Silent compiler warning. */
+
 
 #if 0
   fprintf (stderr,
@@ -120,14 +122,14 @@ value_checker (void *cls,
 
 
 static int
-test_urlencoding ()
+test_urlencoding (void)
 {
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
   unsigned int want_off = URL_START;
-  int i;
-  int delta;
+  size_t i;
+  size_t delta;
   size_t size;
 
   memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -154,7 +156,7 @@ test_urlencoding ()
 
 
 static int
-test_multipart_garbage ()
+test_multipart_garbage (void)
 {
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
@@ -195,7 +197,7 @@ test_multipart_garbage ()
 
 
 static int
-test_multipart_splits ()
+test_multipart_splits (void)
 {
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
@@ -228,14 +230,14 @@ test_multipart_splits ()
 
 
 static int
-test_multipart ()
+test_multipart (void)
 {
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
   unsigned int want_off = FORM_START;
-  int i;
-  int delta;
+  size_t i;
+  size_t delta;
   size_t size;
 
   memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -263,14 +265,14 @@ test_multipart ()
 
 
 static int
-test_nested_multipart ()
+test_nested_multipart (void)
 {
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
   unsigned int want_off = FORM_NESTED_START;
-  int i;
-  int delta;
+  size_t i;
+  size_t delta;
   size_t size;
 
   memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -298,14 +300,14 @@ test_nested_multipart ()
 
 
 static int
-test_empty_value ()
+test_empty_value (void)
 {
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
   unsigned int want_off = URL_EMPTY_VALUE_START;
-  int i;
-  int delta;
+  size_t i;
+  size_t delta;
   size_t size;
 
   memset (&connection, 0, sizeof (struct MHD_Connection));
@@ -337,6 +339,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
+  (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
 
   errorCount += test_multipart_splits ();
   errorCount += test_multipart_garbage ();
diff --git a/src/microhttpd/test_postprocessor_amp.c 
b/src/microhttpd/test_postprocessor_amp.c
index 73f72f92..ef271810 100644
--- a/src/microhttpd/test_postprocessor_amp.c
+++ b/src/microhttpd/test_postprocessor_amp.c
@@ -11,6 +11,8 @@ int check_post(void *cls, enum MHD_ValueKind kind, const 
char* key,
                  const char* content_encoding, const char* data,
                  uint64_t off, size_t size)
 {
+  (void)cls; (void)kind; (void)filename; (void)content_type;  /* Unused. 
Silent compiler warning. */
+  (void)content_encoding; (void)data; (void)off; (void)size;  /* Unused. 
Silent compiler warning. */
   if ((0 != strcmp(key, "a")) && (0 != strcmp(key, "b")))
     {
       printf("ERROR: got unexpected '%s'\n", key);
@@ -26,6 +28,7 @@ main (int argc, char *const *argv)
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
+  (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
 
   memset (&connection, 0, sizeof (struct MHD_Connection));
   memset (&header, 0, sizeof (struct MHD_HTTP_Header));
diff --git a/src/microhttpd/test_postprocessor_large.c 
b/src/microhttpd/test_postprocessor_large.c
index a509a7ba..13e8c78f 100644
--- a/src/microhttpd/test_postprocessor_large.c
+++ b/src/microhttpd/test_postprocessor_large.c
@@ -43,6 +43,8 @@ value_checker (void *cls,
                const char *data, uint64_t off, size_t size)
 {
   unsigned int *pos = cls;
+  (void)kind; (void)key; (void)filename; (void)content_type;  /* Unused. 
Silent compiler warning. */
+  (void)transfer_encoding; (void)data; (void)off;             /* Unused. 
Silent compiler warning. */
 #if 0
   fprintf (stderr,
            "VC: %llu %u `%s' `%s' `%s' `%s' `%.*s'\n",
@@ -63,8 +65,8 @@ test_simple_large ()
   struct MHD_Connection connection;
   struct MHD_HTTP_Header header;
   struct MHD_PostProcessor *pp;
-  int i;
-  int delta;
+  size_t i;
+  size_t delta;
   size_t size;
   char data[102400];
   unsigned int pos;
@@ -98,6 +100,7 @@ int
 main (int argc, char *const *argv)
 {
   unsigned int errorCount = 0;
+  (void)argc; (void)argv;  /* Unused. Silent compiler warning. */
 
   errorCount += test_simple_large ();
   if (errorCount != 0)
diff --git a/src/microhttpd/test_shutdown_select.c 
b/src/microhttpd/test_shutdown_select.c
index e3cd0249..e8942c0b 100644
--- a/src/microhttpd/test_shutdown_select.c
+++ b/src/microhttpd/test_shutdown_select.c
@@ -286,6 +286,7 @@ main (int argc, char *const *argv)
 #endif /* MHD_WINSOCK_SOCKETS */
   bool test_poll;
   bool must_ignore;
+  (void)argc; /* Unused. Silent compiler warning. */
 
   test_poll = has_in_name(argv[0], "_poll");
   must_ignore = has_in_name(argv[0], "_ignore");
diff --git a/src/microhttpd/test_str_token.c b/src/microhttpd/test_str_token.c
index 464cc7a5..15f3f406 100644
--- a/src/microhttpd/test_str_token.c
+++ b/src/microhttpd/test_str_token.c
@@ -111,6 +111,7 @@ int check_not_match(void)
 int main(int argc, char * argv[])
 {
   int errcount = 0;
+  (void)argc; (void)argv; /* Unused. Silent compiler warning. */
   errcount += check_match();
   errcount += check_not_match();
   return errcount == 0 ? 0 : 1;
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index b1a234cb..377e712d 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -443,6 +443,7 @@ notify_completed_cb (void *cls,
                      void **con_cls,
                      enum MHD_RequestTerminationCode toe)
 {
+  (void)cls; (void)connection;  /* Unused. Silent compiler warning. */
   if ( (toe != MHD_REQUEST_TERMINATED_COMPLETED_OK) &&
        (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
        (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
@@ -468,6 +469,8 @@ log_cb (void *cls,
         struct MHD_Connection *connection)
 {
   pthread_t* ppth;
+  (void)cls; (void)connection;  /* Unused. Silent compiler warning. */
+
   if (0 != strcmp (uri,
                    "/"))
     abort ();
@@ -505,6 +508,7 @@ notify_connection_cb (void *cls,
                       enum MHD_ConnectionNotificationCode toe)
 {
   static int started;
+  (void)cls; (void)connection;  /* Unused. Silent compiler warning. */
 
   switch (toe)
   {
@@ -759,6 +763,7 @@ upgrade_cb (void *cls,
             MHD_socket sock,
             struct MHD_UpgradeResponseHandle *urh)
 {
+  (void)cls; (void)connection; (void)con_cls; (void)extra_in; /* Unused. 
Silent compiler warning. */
   usock = wr_create_from_plain_sckt (sock);
   if (0 != extra_in_size)
     abort ();
@@ -821,6 +826,8 @@ ahc_upgrade (void *cls,
 {
   struct MHD_Response *resp;
   int ret;
+  (void)cls;(void)url;(void)method;                        /* Unused. Silent 
compiler warning. */
+  (void)version;(void)upload_data;(void)upload_data_size;  /* Unused. Silent 
compiler warning. */
 
   if (NULL == *con_cls)
     abort ();
@@ -898,6 +905,7 @@ run_mhd_select_loop (struct MHD_Daemon *daemon)
 static void
 run_mhd_poll_loop (struct MHD_Daemon *daemon)
 {
+  (void)daemon; /* Unused. Silent compiler warning. */
   abort (); /* currently not implementable with existing MHD API */
 }
 #endif /* HAVE_POLL */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]