Skip to content

Commit 0b97973

Browse files
MarekVCodasipborneoa
authored andcommitted
vdebug: Fix socket comparison warning on Windows
On GCC version 13.2, the previous code emitted the following warning on Windows: openocd/src/jtag/drivers/vdebug.c:254:19: warning: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Wsign-compare] 254 | if (hsock == INVALID_SOCKET) This patch fixes it and brings it in line with other socket handling code. Change-Id: I7e05f83c6905cfaf66b68e8988c783e80cee4a48 Signed-off-by: Marek Vrbka <[email protected]> Reviewed-on: https://review.openocd.org/c/openocd/+/8717 Tested-by: jenkins Reviewed-by: Jan Matyas <[email protected]> Reviewed-by: Jacek Wuwer <[email protected]> Reviewed-by: Antonio Borneo <[email protected]> Reviewed-by: R. Diez <[email protected]>
1 parent 77f9da7 commit 0b97973

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/jtag/drivers/vdebug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ static int vdebug_socket_open(char *server_addr, uint32_t port)
252252

253253
#ifdef _WIN32
254254
hsock = socket(AF_INET, SOCK_STREAM, IPPROTO_IP);
255-
if (hsock == INVALID_SOCKET)
255+
if (hsock < 0)
256256
rc = vdebug_socket_error();
257257
#elif defined __CYGWIN__
258258
/* SO_RCVLOWAT unsupported on CYGWIN */

0 commit comments

Comments
 (0)