Repository navigation
Commit 2e803ed
committed
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.1 parent 2ecb0f7 commit 2e803ed
2 files changed
Lines changed: 43 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | 90 | | |
94 | 91 | | |
95 | 92 | | |
| |||
401 | 398 | | |
402 | 399 | | |
403 | 400 | | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
410 | 407 | | |
411 | 408 | | |
412 | 409 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
| |||
293 | 299 | | |
294 | 300 | | |
295 | 301 | | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
300 | 307 | | |
301 | 308 | | |
302 | 309 | | |
303 | 310 | | |
304 | 311 | | |
305 | 312 | | |
306 | | - | |
307 | | - | |
| 313 | + | |
| 314 | + | |
308 | 315 | | |
309 | 316 | | |
310 | 317 | | |
| |||
316 | 323 | | |
317 | 324 | | |
318 | 325 | | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
323 | 333 | | |
324 | 334 | | |
325 | 335 | | |
| |||
401 | 411 | | |
402 | 412 | | |
403 | 413 | | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
404 | 421 | | |
405 | 422 | | |
406 | 423 | | |
| |||
0 commit comments