Skip to content
Permalink
Browse files

samples: google_iot_mqtt: Explicitly cast socklen_t to int in printf

Otherwise, it can lead to warning like:

main.c:80:10: warning: format '%d' expects argument of type 'int',
but argument 2 has type 'socklen_t' {aka 'long unsigned int'}
[-Wformat=]

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
  • Loading branch information...
pfalcon authored and jukkar committed May 10, 2019
1 parent 220fba3 commit 6f6b46971a76deb41851b37ce0f6ea65b5287c71
Showing with 1 addition and 1 deletion.
  1. +1 −1 samples/net/google_iot_mqtt/src/main.c
@@ -77,7 +77,7 @@ static void show_addrinfo(struct addrinfo *addr)
LOG_DBG(" family : %d", addr->ai_family);
LOG_DBG(" socktype: %d", addr->ai_socktype);
LOG_DBG(" protocol: %d", addr->ai_protocol);
LOG_DBG(" addrlen : %d", addr->ai_addrlen);
LOG_DBG(" addrlen : %d", (int)addr->ai_addrlen);

/* Assume two words. */
LOG_DBG(" addr[0]: 0x%lx", ((uint32_t *)addr->ai_addr)[0]);

0 comments on commit 6f6b469

Please sign in to comment.
You can’t perform that action at this time.