[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 <f4aac44ad8166b1b5ad1adb5339eb35a21016254-EmailReplacePatchSet-HTML@gerrit.openvpn.net>
cron2 has uploaded a new patch set (#10) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1527?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by razvanc


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(-)


  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1527/10

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: newpatchset
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.