[Openvpn-devel] [S] Change in openvpn[master]: tun: Avoid sign-compare warning in header_modify_read_write_return
"cron2 \(Code Review\) via Openvpn-devel" <[email protected]>
| Newsgroups | net.sourceforge.lists.openvpn-devel |
|---|---|
| Message-ID | <[email protected]> |
cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1527?usp=email ) Change subject: tun: Avoid sign-compare warning in header_modify_read_write_return ...................................................................... tun: Avoid sign-compare warning in header_modify_read_write_return Since we already check that the value is positive just make the implicit cast explicit. Change-Id: I2ca40d0d86599896b38ea1467313b6a6cdc8339c Signed-off-by: Frank Lichtenheld <[email protected]> Acked-by: Razvan Cojocaru <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1527 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg38330.html Signed-off-by: Gert Doering <[email protected]> --- M src/openvpn/tun.c 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index e7193d8..f2a4394 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -1706,17 +1706,12 @@ #include <netinet/ip.h> #include <sys/uio.h> -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wsign-compare" -#endif - static inline ssize_t header_modify_read_write_return(ssize_t len) { if (len > 0) { - return len > sizeof(u_int32_t) ? len - sizeof(u_int32_t) : 0; + return (size_t)len > sizeof(u_int32_t) ? len - sizeof(u_int32_t) : 0; } else { @@ -1724,10 +1719,6 @@ } } -#if defined(__GNUC__) || defined(__clang__) -#pragma GCC diagnostic pop -#endif - static ssize_t write_tun_header(struct tuntap *tt, uint8_t *buf, int len) { -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1527?usp=email To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I2ca40d0d86599896b38ea1467313b6a6cdc8339c Gerrit-Change-Number: 1527 Gerrit-PatchSet: 10 Gerrit-Owner: flichtenheld <[email protected]> Gerrit-Reviewer: plaisthos <[email protected]> Gerrit-Reviewer: razvanc <[email protected]> Gerrit-CC: openvpn-devel <[email protected]> _______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel