Windows msys2 + mingw64, openssl 3.1 : warnings in apps/lib/s_socket.c
Open
Nobody has claimed this yet.
triaged: bug
- Dominant language
- C
- Stars
- 30.8k
- Forks
- 11.5k
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
warnings:
apps/lib/s_socket.c:141:25: warning: overflow in conversion from 'long long unsigned int' to 'int' changes value from '18446744073709551615' to '-1' [-Woverflo
]
141 | *sock = INVALID_SOCKET;
| ^~~~~~~~~~~~~~
apps/lib/s_socket.c:167:21: warning: overflow in conversion from 'long long unsigned int' to 'int' changes value from '18446744073709551615' to '-1' [-Woverflo
]
167 | *sock = INVALID_SOCKET;
| ^~~~~~~~~~~~~~
indeed, on Windows, SOCKET is defined as typedef UINT_PTR SOCKET; and INVALID_SOCKET is defined as #define INVALID_SOCKET (SOCKET)(~0), while *sock is an int
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/lib/s_socket.c at lines 141 and 167, then inspect the Windows SOCKET and INVALID_SOCKET definitions involved in assigning to *sock. Confirm the fix by rebuilding the affected Windows msys2/mingw64 configuration and verifying that these overflow warnings no longer appear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100