This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 8a11d079d94e636b5a6745387d5b993cd7fc313b Author: Marco Casaroli <[email protected]> AuthorDate: Wed Oct 28 22:16:57 2026 +0100 apps: Include <stdbool.h> where bool, true and false are used. These files and headers used bool, true or false but did not include <stdbool.h>. They got the macros only through other headers, for example <pthread.h> and <stdio.h> through <nuttx/mutex.h>, or <sys/ioctl.h>. The C standard does not let the standard headers define these macros, and the NuttX standard headers will stop doing so before C23. Include <stdbool.h> in each file that uses them: - ostest: pthread_cleanup.c, pthread_rwlock.c, pthread_rwlock_cancel.c and sporadic2.c; - the headers dhcpd_daemon.h, mdnsd_daemon.h, nxcodec_context.h, logging/nxscope/nxscope.h, netutils/ptpd.h, nshlib/nshlib.h and system/settings.h; - 28 other programs in benchmarks, examples, fsutils, interpreters, netutils, system and testing. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Marco Casaroli <[email protected]> --- benchmarks/sd_bench/sd_bench_main.c | 1 + examples/dhcpd/dhcpd_daemon.h | 2 ++ examples/dhcpd/dhcpd_start.c | 1 + examples/dhcpd/target.c | 1 + examples/fxos8700cq_test/fxos8700cq_main.c | 1 + examples/mdnsd/mdnsd_daemon.h | 2 ++ examples/mdnsd/mdnsd_start.c | 1 + examples/mdnsd/mdnsd_stop.c | 1 + examples/nxscope/nxscope_main.c | 1 + examples/optee/optee_main.c | 1 + examples/pty_test/pty_test.c | 1 + examples/tcp_ipc_server/uart_lorawan_layer.c | 1 + fsutils/passwd/passwd_delete.c | 1 + include/logging/nxscope/nxscope.h | 1 + include/netutils/ptpd.h | 1 + include/nshlib/nshlib.h | 1 + include/system/settings.h | 1 + netutils/plcatool/plcatool.c | 1 + system/hostname/hostname_main.c | 1 + system/nxcodec/nxcodec.c | 1 + system/nxcodec/nxcodec_context.c | 1 + system/nxcodec/nxcodec_context.h | 1 + system/ptpd/ptpd_main.c | 1 + system/resmonitor/fillcpu.c | 1 + system/resmonitor/showinfo.c | 1 + system/taskset/taskset.c | 1 + system/tcpdump/tcpdump.c | 1 + testing/drivers/crypto/rsa.c | 1 + testing/drivers/drivertest/drivertest_i2c_read.c | 1 + testing/drivers/drivertest/drivertest_uart.c | 1 + testing/drivers/pcitest/pcitest.c | 1 + testing/drivers/sd_stress/sd_stress_main.c | 1 + testing/drivers/setest/setest.c | 1 + testing/libc/printfengine/printfengine_main.c | 1 + testing/libc/printftest/printftest_main.c | 1 + testing/ostest/pthread_cleanup.c | 1 + testing/ostest/pthread_rwlock.c | 1 + testing/ostest/pthread_rwlock_cancel.c | 1 + testing/ostest/sporadic2.c | 1 + 39 files changed, 41 insertions(+) diff --git a/benchmarks/sd_bench/sd_bench_main.c b/benchmarks/sd_bench/sd_bench_main.c index aa5b7256f..cedcb35c1 100644 --- a/benchmarks/sd_bench/sd_bench_main.c +++ b/benchmarks/sd_bench/sd_bench_main.c @@ -47,6 +47,7 @@ #include <errno.h> #include <fcntl.h> +#include <stdbool.h> #include <stddef.h> #include <stdint.h> #include <stdio.h> diff --git a/examples/dhcpd/dhcpd_daemon.h b/examples/dhcpd/dhcpd_daemon.h index 8dc06a37f..a6d3ccb43 100644 --- a/examples/dhcpd/dhcpd_daemon.h +++ b/examples/dhcpd/dhcpd_daemon.h @@ -27,6 +27,8 @@ * Included Files ****************************************************************************/ +#include <stdbool.h> + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ diff --git a/examples/dhcpd/dhcpd_start.c b/examples/dhcpd/dhcpd_start.c index e5e7d5c24..4d672c29b 100644 --- a/examples/dhcpd/dhcpd_start.c +++ b/examples/dhcpd/dhcpd_start.c @@ -26,6 +26,7 @@ #include <nuttx/config.h> +#include <stdbool.h> #include <stdio.h> #include "dhcpd_daemon.h" diff --git a/examples/dhcpd/target.c b/examples/dhcpd/target.c index 3a5117f61..b0f6328a2 100644 --- a/examples/dhcpd/target.c +++ b/examples/dhcpd/target.c @@ -26,6 +26,7 @@ #include <nuttx/config.h> +#include <stdbool.h> #include <stdio.h> #include "dhcpd_daemon.h" diff --git a/examples/fxos8700cq_test/fxos8700cq_main.c b/examples/fxos8700cq_test/fxos8700cq_main.c index e30d6f2ff..e1b8464fc 100644 --- a/examples/fxos8700cq_test/fxos8700cq_main.c +++ b/examples/fxos8700cq_test/fxos8700cq_main.c @@ -27,6 +27,7 @@ #include <nuttx/config.h> #include <fcntl.h> +#include <stdbool.h> #include <stdio.h> #include <unistd.h> diff --git a/examples/mdnsd/mdnsd_daemon.h b/examples/mdnsd/mdnsd_daemon.h index 7adcdddc8..ab4e056b6 100644 --- a/examples/mdnsd/mdnsd_daemon.h +++ b/examples/mdnsd/mdnsd_daemon.h @@ -27,6 +27,8 @@ * Included Files ****************************************************************************/ +#include <stdbool.h> + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ diff --git a/examples/mdnsd/mdnsd_start.c b/examples/mdnsd/mdnsd_start.c index 865bde967..4efe79de4 100644 --- a/examples/mdnsd/mdnsd_start.c +++ b/examples/mdnsd/mdnsd_start.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include <nuttx/config.h> +#include <stdbool.h> #include <stdio.h> #include "mdnsd_daemon.h" diff --git a/examples/mdnsd/mdnsd_stop.c b/examples/mdnsd/mdnsd_stop.c index 45da47dd2..0443ac208 100644 --- a/examples/mdnsd/mdnsd_stop.c +++ b/examples/mdnsd/mdnsd_stop.c @@ -25,6 +25,7 @@ ****************************************************************************/ #include <nuttx/config.h> +#include <stdbool.h> #include <stdio.h> #include "mdnsd_daemon.h" diff --git a/examples/nxscope/nxscope_main.c b/examples/nxscope/nxscope_main.c index ba0a3c226..ae0df22e5 100644 --- a/examples/nxscope/nxscope_main.c +++ b/examples/nxscope/nxscope_main.c @@ -32,6 +32,7 @@ #include <errno.h> #include <getopt.h> #include <pthread.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> diff --git a/examples/optee/optee_main.c b/examples/optee/optee_main.c index c089145d4..cd60426bc 100644 --- a/examples/optee/optee_main.c +++ b/examples/optee/optee_main.c @@ -28,6 +28,7 @@ #include <stdio.h> #include <fcntl.h> #include <stdlib.h> +#include <stdbool.h> #include <unistd.h> #include <errno.h> #include <sys/ioctl.h> diff --git a/examples/pty_test/pty_test.c b/examples/pty_test/pty_test.c index 15b519f1d..ff33fcdc8 100644 --- a/examples/pty_test/pty_test.c +++ b/examples/pty_test/pty_test.c @@ -28,6 +28,7 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> +#include <stdbool.h> #include <unistd.h> #include <sys/types.h> #include <sys/stat.h> diff --git a/examples/tcp_ipc_server/uart_lorawan_layer.c b/examples/tcp_ipc_server/uart_lorawan_layer.c index eefea9977..c91c5c1af 100644 --- a/examples/tcp_ipc_server/uart_lorawan_layer.c +++ b/examples/tcp_ipc_server/uart_lorawan_layer.c @@ -27,6 +27,7 @@ #include <nuttx/config.h> #include <inttypes.h> #include <stdio.h> +#include <stdbool.h> #include <fcntl.h> #include <unistd.h> #include <sys/time.h> diff --git a/fsutils/passwd/passwd_delete.c b/fsutils/passwd/passwd_delete.c index fe620af93..f975258d0 100644 --- a/fsutils/passwd/passwd_delete.c +++ b/fsutils/passwd/passwd_delete.c @@ -29,6 +29,7 @@ #include <sys/types.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <unistd.h> #include <assert.h> #include <errno.h> diff --git a/include/logging/nxscope/nxscope.h b/include/logging/nxscope/nxscope.h index f5394f694..3a01e0a4d 100644 --- a/include/logging/nxscope/nxscope.h +++ b/include/logging/nxscope/nxscope.h @@ -31,6 +31,7 @@ #include <nuttx/compiler.h> #include <pthread.h> +#include <stdbool.h> #include <stdint.h> #include <logging/nxscope/nxscope_chan.h> diff --git a/include/netutils/ptpd.h b/include/netutils/ptpd.h index 7bceb1b79..efcf6793a 100644 --- a/include/netutils/ptpd.h +++ b/include/netutils/ptpd.h @@ -27,6 +27,7 @@ * Included Files ****************************************************************************/ +#include <stdbool.h> #include <sys/types.h> /**************************************************************************** diff --git a/include/nshlib/nshlib.h b/include/nshlib/nshlib.h index 8ef1fe783..e561adf84 100644 --- a/include/nshlib/nshlib.h +++ b/include/nshlib/nshlib.h @@ -30,6 +30,7 @@ #include <nuttx/config.h> #include <arpa/inet.h> +#include <stdbool.h> /**************************************************************************** * Pre-processor Definitions diff --git a/include/system/settings.h b/include/system/settings.h index 943be7add..49e191e51 100644 --- a/include/system/settings.h +++ b/include/system/settings.h @@ -29,6 +29,7 @@ #include <nuttx/config.h> #include <netinet/in.h> +#include <stdbool.h> #include <stdint.h> #include <sys/types.h> #include <pthread.h> diff --git a/netutils/plcatool/plcatool.c b/netutils/plcatool/plcatool.c index 75a768b45..9ab2da63a 100644 --- a/netutils/plcatool/plcatool.c +++ b/netutils/plcatool/plcatool.c @@ -29,6 +29,7 @@ #include <stdio.h> #include <stdlib.h> #include <stdint.h> +#include <stdbool.h> #include <string.h> #include <unistd.h> #include <errno.h> diff --git a/system/hostname/hostname_main.c b/system/hostname/hostname_main.c index be6d101d8..28c227c6d 100644 --- a/system/hostname/hostname_main.c +++ b/system/hostname/hostname_main.c @@ -24,6 +24,7 @@ * Included Files ****************************************************************************/ +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> diff --git a/system/nxcodec/nxcodec.c b/system/nxcodec/nxcodec.c index 729676fce..23a2a0779 100644 --- a/system/nxcodec/nxcodec.c +++ b/system/nxcodec/nxcodec.c @@ -27,6 +27,7 @@ #include <sys/ioctl.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> diff --git a/system/nxcodec/nxcodec_context.c b/system/nxcodec/nxcodec_context.c index 601dc3b22..c99d74ddc 100644 --- a/system/nxcodec/nxcodec_context.c +++ b/system/nxcodec/nxcodec_context.c @@ -28,6 +28,7 @@ #include <sys/mman.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <unistd.h> #include <fcntl.h> #include <errno.h> diff --git a/system/nxcodec/nxcodec_context.h b/system/nxcodec/nxcodec_context.h index b679380ff..9d8eeac84 100644 --- a/system/nxcodec/nxcodec_context.h +++ b/system/nxcodec/nxcodec_context.h @@ -27,6 +27,7 @@ * Included Files ****************************************************************************/ +#include <stdbool.h> #include <sys/videoio.h> /**************************************************************************** diff --git a/system/ptpd/ptpd_main.c b/system/ptpd/ptpd_main.c index c66caf6e5..31caba743 100644 --- a/system/ptpd/ptpd_main.c +++ b/system/ptpd/ptpd_main.c @@ -29,6 +29,7 @@ #include <stdint.h> #include <stdlib.h> #include <stdio.h> +#include <stdbool.h> #include <sys/socket.h> #include <unistd.h> diff --git a/system/resmonitor/fillcpu.c b/system/resmonitor/fillcpu.c index 28e6dab85..ffa425e27 100644 --- a/system/resmonitor/fillcpu.c +++ b/system/resmonitor/fillcpu.c @@ -26,6 +26,7 @@ #include <fcntl.h> #include <signal.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/system/resmonitor/showinfo.c b/system/resmonitor/showinfo.c index bf2de6544..415f67ed2 100644 --- a/system/resmonitor/showinfo.c +++ b/system/resmonitor/showinfo.c @@ -26,6 +26,7 @@ #include <malloc.h> #include <signal.h> +#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> diff --git a/system/taskset/taskset.c b/system/taskset/taskset.c index bae0246a9..3e8ea5639 100644 --- a/system/taskset/taskset.c +++ b/system/taskset/taskset.c @@ -26,6 +26,7 @@ #include <nuttx/config.h> +#include <stdbool.h> #include <sys/types.h> #include <sys/wait.h> diff --git a/system/tcpdump/tcpdump.c b/system/tcpdump/tcpdump.c index b7d96fc71..4b669a606 100644 --- a/system/tcpdump/tcpdump.c +++ b/system/tcpdump/tcpdump.c @@ -33,6 +33,7 @@ #include <netinet/if_ether.h> #include <netinet/in.h> #include <netpacket/packet.h> +#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <sys/ioctl.h> diff --git a/testing/drivers/crypto/rsa.c b/testing/drivers/crypto/rsa.c index 462aa2fc1..f45fe7435 100644 --- a/testing/drivers/crypto/rsa.c +++ b/testing/drivers/crypto/rsa.c @@ -22,6 +22,7 @@ #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <unistd.h> #include <fcntl.h> diff --git a/testing/drivers/drivertest/drivertest_i2c_read.c b/testing/drivers/drivertest/drivertest_i2c_read.c index ce0c812a7..e8a56eb77 100644 --- a/testing/drivers/drivertest/drivertest_i2c_read.c +++ b/testing/drivers/drivertest/drivertest_i2c_read.c @@ -28,6 +28,7 @@ #include <nuttx/i2c/i2c_master.h> #include <sys/ioctl.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/testing/drivers/drivertest/drivertest_uart.c b/testing/drivers/drivertest/drivertest_uart.c index 41ac4cb72..0d0028f0b 100644 --- a/testing/drivers/drivertest/drivertest_uart.c +++ b/testing/drivers/drivertest/drivertest_uart.c @@ -32,6 +32,7 @@ #include <stdio.h> #include <stdint.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <termios.h> #include <unistd.h> diff --git a/testing/drivers/pcitest/pcitest.c b/testing/drivers/pcitest/pcitest.c index 3ba9f2e12..100068708 100644 --- a/testing/drivers/pcitest/pcitest.c +++ b/testing/drivers/pcitest/pcitest.c @@ -29,6 +29,7 @@ #include <unistd.h> #include <fcntl.h> #include <stdlib.h> +#include <stdbool.h> #include <sys/ioctl.h> #include <nuttx/pci/pci_ep_test.h> diff --git a/testing/drivers/sd_stress/sd_stress_main.c b/testing/drivers/sd_stress/sd_stress_main.c index 21a52e11d..5d87b1634 100644 --- a/testing/drivers/sd_stress/sd_stress_main.c +++ b/testing/drivers/sd_stress/sd_stress_main.c @@ -54,6 +54,7 @@ #include <stdint.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> diff --git a/testing/drivers/setest/setest.c b/testing/drivers/setest/setest.c index fea5b23c2..8c0aec392 100644 --- a/testing/drivers/setest/setest.c +++ b/testing/drivers/setest/setest.c @@ -31,6 +31,7 @@ #include <nuttx/crypto/se05x.h> #include <stdio.h> #include <stdlib.h> +#include <stdbool.h> #include <string.h> #include <unistd.h> #include <sys/ioctl.h> diff --git a/testing/libc/printfengine/printfengine_main.c b/testing/libc/printfengine/printfengine_main.c index a2b887366..b6a93cef6 100644 --- a/testing/libc/printfengine/printfengine_main.c +++ b/testing/libc/printfengine/printfengine_main.c @@ -29,6 +29,7 @@ #include <assert.h> #include <float.h> #include <stdarg.h> +#include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <string.h> diff --git a/testing/libc/printftest/printftest_main.c b/testing/libc/printftest/printftest_main.c index 0ced95230..4fb74d0b7 100644 --- a/testing/libc/printftest/printftest_main.c +++ b/testing/libc/printftest/printftest_main.c @@ -31,6 +31,7 @@ #include <float.h> #include <limits.h> #include <stdarg.h> +#include <stdbool.h> #include <stdio.h> #include <string.h> diff --git a/testing/ostest/pthread_cleanup.c b/testing/ostest/pthread_cleanup.c index 774733ba7..4e92c8b02 100644 --- a/testing/ostest/pthread_cleanup.c +++ b/testing/ostest/pthread_cleanup.c @@ -27,6 +27,7 @@ #include <assert.h> #include <errno.h> #include <pthread.h> +#include <stdbool.h> #include <stdio.h> #include <unistd.h> diff --git a/testing/ostest/pthread_rwlock.c b/testing/ostest/pthread_rwlock.c index ed4159d80..bd7803b79 100644 --- a/testing/ostest/pthread_rwlock.c +++ b/testing/ostest/pthread_rwlock.c @@ -27,6 +27,7 @@ #include <assert.h> #include <errno.h> #include <pthread.h> +#include <stdbool.h> #include <stdio.h> /**************************************************************************** diff --git a/testing/ostest/pthread_rwlock_cancel.c b/testing/ostest/pthread_rwlock_cancel.c index 7a99e8865..f9efed3bd 100644 --- a/testing/ostest/pthread_rwlock_cancel.c +++ b/testing/ostest/pthread_rwlock_cancel.c @@ -28,6 +28,7 @@ #include <errno.h> #include <pthread.h> #include <sched.h> +#include <stdbool.h> #include <stdio.h> #include <unistd.h> diff --git a/testing/ostest/sporadic2.c b/testing/ostest/sporadic2.c index 494dc8b29..a84219412 100644 --- a/testing/ostest/sporadic2.c +++ b/testing/ostest/sporadic2.c @@ -30,6 +30,7 @@ #include <pthread.h> #include <sched.h> #include <semaphore.h> +#include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <sys/param.h>
