From 3a5c3a5c1b0eb756a2258aea87f3bacb89199064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 7 Jun 2016 14:50:50 +0200 Subject: erts: Remove tautological compare warning --- erts/emulator/beam/erl_bif_port.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erts/emulator/beam/erl_bif_port.c b/erts/emulator/beam/erl_bif_port.c index 37f4e1de49..fefa9d8391 100644 --- a/erts/emulator/beam/erl_bif_port.c +++ b/erts/emulator/beam/erl_bif_port.c @@ -1411,7 +1411,7 @@ BIF_RETTYPE decode_packet_3(BIF_ALIST_3) trunc_len = val; goto next_option; case am_line_delimiter: - if (type == TCP_PB_LINE_LF && val >= 0 && val <= 255) { + if (type == TCP_PB_LINE_LF && val <= 255) { delimiter = (char)val; goto next_option; } -- cgit v1.2.3 From 4c6ccf1c2f13d4b6ea34bc0eecc8a772cb38e80a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 7 Jun 2016 15:29:11 +0200 Subject: erts: Let clang have suppressable unused variables --- erts/emulator/beam/sys.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erts/emulator/beam/sys.h b/erts/emulator/beam/sys.h index 9a205d50d3..dfe82cab44 100644 --- a/erts/emulator/beam/sys.h +++ b/erts/emulator/beam/sys.h @@ -154,8 +154,9 @@ typedef ERTS_SYS_FD_TYPE ErtsSysFdType; # define ERTS_WRITE_UNLIKELY(X) X #endif +/* clang may have too low __GNUC__ versions but can handle it */ #ifdef __GNUC__ -# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5) || defined(__clang__) # define ERTS_DECLARE_DUMMY(X) X __attribute__ ((unused)) # else # define ERTS_DECLARE_DUMMY(X) X -- cgit v1.2.3 From e2bb65e6354123ac5d0ec9e2c1de6a92ae581161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Tue, 7 Jun 2016 16:07:09 +0200 Subject: erl_interface: Let struct iovec * be visible --- lib/erl_interface/src/misc/ei_portio.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/erl_interface/src/misc/ei_portio.h b/lib/erl_interface/src/misc/ei_portio.h index a14fdbd7d1..fbb61b0ccf 100644 --- a/lib/erl_interface/src/misc/ei_portio.h +++ b/lib/erl_interface/src/misc/ei_portio.h @@ -21,6 +21,12 @@ */ #ifndef _EI_PORTIO_H #define _EI_PORTIO_H +#if !defined(__WIN32__) || !defined(VXWORKS) +#ifdef HAVE_WRITEV +/* Declaration of struct iovec *iov should be visible in this scope. */ +#include +#endif +#endif int ei_accept_t(int fd, void *addr, void *addrlen, unsigned ms); int ei_connect_t(int fd, void *sinp, int sin_siz, unsigned ms); @@ -29,8 +35,7 @@ int ei_write_fill(int fd, const char *buf, int len); int ei_read_fill_t(int fd, char* buf, int len, unsigned ms); int ei_write_fill_t(int fd, const char *buf, int len, unsigned ms); #ifdef HAVE_WRITEV -int ei_writev_fill_t(int fd, const struct iovec *iov, int iovcnt, - unsigned ms); +int ei_writev_fill_t(int fd, const struct iovec *iov, int iovcnt, unsigned ms); #endif #endif /* _EI_PORTIO_H */ -- cgit v1.2.3