You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ci: fix CodeQL fd_set forward-decl and Windows socklen_t static_assert
Two regressions from the TASK-020 hygiene sweep broke the CI matrix on
PR #374:
1. CodeQL (Linux/glibc): `struct fd_set;` is a typedef-name-after-struct
error on glibc, where fd_set is a typedef of an unnamed struct (no
struct tag). The forward declaration only happened to compile on
platforms whose `<stdlib.h>` chain did not transitively pull in
`<sys/select.h>`. Replace with a platform-conditional include of
`<sys/select.h>` (POSIX/Cygwin) or `<winsock2.h>` (Windows), and
drop the `struct` keyword from the `fd_set*` parameter types in
webserver::get_fdset's signature and implementation.
2. Windows MSYS2: `static_assert(std::is_unsigned<socklen_t>::value)`
fires because winsock2 typedefs socklen_t as signed `int`. Drop the
assertion; the size assertion remains, and the unsigned->socklen_t
conversion in add_connection is value-preserving for any realistic
sockaddr length on every supported platform. Update the doc on
webserver::add_connection to reflect the actual portable contract.
0 commit comments