casaroli opened a new pull request, #4047:
URL: https://github.com/apache/nuttx-apps/pull/4047

   depends-on: apache/nuttx/pull/21819
   
   ## Summary
   
   `nshlib/nsh.h` undefines `NSH_HAVE_CATFILE` when cat, ifconfig, ifup/down, 
df, free and env are all enabled, and irqinfo and the mount list are not. The 
test of the six commands is inverted: `cat` always uses `nsh_catfile()`. With 
procfs, no network, no IRQ monitor and `CONFIG_FS_PROCFS_EXCLUDE_MOUNT=y` 
(qemu-armv8a:nsh), NSH does not build:
   
   ```
   nsh_command.c:434:23: error: 'cmd_mount' undeclared here (not in a 
function); did you mean 'cmd_umount'?
   ```
   
   More commands call `nsh_catfile()` than the list names (dmesg, fdinfo, 
route, ...). This PR removes the test, so `nsh_catfile()` is always built.
   
   ## Impact
   
   - Configurations that hit the inverted test build again. In all other 
configurations `NSH_HAVE_CATFILE` was already defined, so they do not change.
   - A configuration with none of the commands keeps `nsh_catfile()` in 
nsh_fsutils.c; with `--gc-sections` the linker removes it.
   - No Kconfig or documentation change.
   
   ## Testing
   
   qemu-armv8a:nsh, `EXTRAFLAGS="-Wno-cpp -Werror"`, aarch64-none-elf-gcc 
14.2.1, nuttx master 562db43781f with apache/nuttx#21824 (the procfs `fs/mount` 
link fix): all 8 combinations of `FS_PROCFS_EXCLUDE_MOUNT`, `_BLOCKS` and 
`_USAGE` build with no warnings. In QEMU with `FS_PROCFS_EXCLUDE_MOUNT=y`, 
`cat`, `df` and `df -h` work. nuttx-apps master fails as shown above.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
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]

Reply via email to