Skip to content

netutils/netcat, system/nxinit: Include the headers that are used. - #3831

Open
casaroli wants to merge 2 commits into
apache:masterfrom
casaroli:apps-stdio-includes
Open

casaroli wants to merge 2 commits into
apache:masterfrom
casaroli:apps-stdio-includes

Conversation

@casaroli

@casaroli casaroli commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

netutils/netcat/netcat_main.c uses errno and true, and system/nxinit/parser.c uses errno, E2BIG, EINTR and EINVAL. Neither file includes errno.h, and netcat_main.c does not include stdbool.h. They compile only because stdio.h includes them indirectly. This PR adds the includes.

The first commit adds a blank line in netcat_main.c to fix its old nxstyle error. It does not change code.

Impact

None. The two files include what they use.

Testing

Builds with -Wno-cpp -Werror and a stdio.h that does not include nuttx/fs/fs.h and nuttx/lib/lib.h (see apache/nuttx#20565):

Configuration File Before After
lm3s6965-ek:qemu-flat netcat_main.c error OK
rv-virt:nsh64 nxinit/parser.c 6 errors OK

tools/checkpatch.sh -c -u -m -g passes.

Add the blank line after the declarations in main().  No code change.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
netcat_main.c uses errno and true, and nxinit/parser.c uses errno and
the error codes, but neither file includes errno.h, and netcat_main.c
does not include stdbool.h.  They compile only because other headers
include them indirectly.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

@cederom cederom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @casaroli :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants