casaroli opened a new pull request, #20635:
URL: https://github.com/apache/nuttx/pull/20635
## Summary
Three small gaps in the headers, one commit each:
- `sys/wait.h`: `WIFCONTINUED()`, `WIFSIGNALED()`, `WIFSTOPPED()` and
`WSTOPSIG()` expand to `false`, but `sys/wait.h` does not include `stdbool.h`.
A C program that uses them without `stdbool.h` does not compile (`'false'
undeclared`). They now expand to 0.
- `netinet/in.h`: POSIX defines `in6addr_loopback` next to `in6addr_any`,
and `IN6_IS_ADDR_MC_NODELOCAL()`, `_SITELOCAL()`, `_ORGLOCAL()` and `_GLOBAL()`
next to `IN6_IS_ADDR_MC_LINKLOCAL()`. NuttX has only the latter of each. This
PR adds them, with the multicast scopes of RFC 4291.
- `sys/param.h`: BSD code sizes path buffers with `MAXPATHLEN`, as it does
host names with `MAXHOSTNAMELEN`, which NuttX already defines. This PR adds it
as `PATH_MAX`.
## Impact
Headers only, plus the `in6addr_loopback` constant in `lib_addrconfig.c`.
Existing code does not change. More portable code compiles.
## Testing
A test file that includes `sys/param.h`, `sys/wait.h` and `netinet/in.h` (no
`stdbool.h`) and uses `MAXPATHLEN`, the four `sys/wait.h` macros, the four new
`IN6_IS_ADDR_MC_*()` macros and `in6addr_loopback`, compiled with
`aarch64-none-elf-gcc -std=c99 -Wall -fsyntax-only` against the
`qemu-armv8a:nsh` headers:
```
master: error: 'MAXPATHLEN' undeclared here (not in a function)
error: 'false' undeclared (first use in this function)
error: implicit declaration of function 'IN6_IS_ADDR_MC_NODELOCAL'
error: 'in6addr_loopback' undeclared (first use in this function)
this PR: no errors, no warnings
```
Build: `qemu-armv8a:nsh`, `qemu-armv8a:knsh` and `lm3s6965-ek:qemu-flat`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]