IOT-2539 Cleanup unused-parameter warning 95/22195/2
authorGeorge Nash <george.nash@intel.com>
Mon, 7 Aug 2017 21:40:26 +0000 (14:40 -0700)
committerRick Bell <richard.s.bell@intel.com>
Thu, 21 Sep 2017 16:48:50 +0000 (16:48 +0000)
This is a set of code that will sometimes have a warning
depending on what is defined. To prevent the
unused-parameter warning the parameters are cast to void.
A empty operation that will be compiled out but prevents
the warning.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I08c73fb565b62d3a760956976a012331863a6c73
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21769
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit 598e8c5b7e7ad9cfc6fab77f5843e5e390509728)

resource/csdk/connectivity/lib/libcoap-4.1.1/debug.c

index 215e4d4..504d632 100644 (file)
@@ -140,6 +140,11 @@ print_readable(const unsigned char *data, unsigned int len, unsigned char *resul
 
 size_t
 coap_print_addr(const struct coap_address_t *addr, unsigned char *buf, size_t len) {
+    // Depending on what is defined its possible that the input parameters
+    // are not used. Cast them to void avoid unused-parameter warnings
+    (void)addr;
+    (void)buf;
+    (void)len;
 #if defined(HAVE_ARPA_INET_H) || defined(_WIN32)
     const void *addrptr = NULL;
 #if defined(__ANDROID__)