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
The following commit(s) were added to refs/heads/master by this push:
new 93c3d23da system/nxdiag: Include stdlib.h for exit().
93c3d23da is described below
commit 93c3d23da427e9934a101bc025a6055faafe39ef
Author: Marco Casaroli <[email protected]>
AuthorDate: Wed Oct 14 23:26:54 2026 +0200
system/nxdiag: Include stdlib.h for exit().
nxdiag_main() calls exit() with EXIT_SUCCESS and EXIT_FAILURE in every
configuration, but nxdiag.c included stdlib.h only with
CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL. stdio.h no longer brings
in stdlib.h, so esp32-devkitc:nxdiag fails to build:
nxdiag.c:241:7: error: implicit declaration of function 'exit'
Include stdlib.h unconditionally.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
---
system/nxdiag/nxdiag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/system/nxdiag/nxdiag.c b/system/nxdiag/nxdiag.c
index dbdd476f5..bfa323127 100644
--- a/system/nxdiag/nxdiag.c
+++ b/system/nxdiag/nxdiag.c
@@ -26,6 +26,7 @@
#include <stdbool.h>
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <sys/param.h>
#include <unistd.h>
@@ -36,7 +37,6 @@
#include "sysinfo.h"
#ifdef CONFIG_SYSTEM_NXDIAG_ESPRESSIF_CHIP_WO_TOOL
#include <fcntl.h>
-#include <stdlib.h>
#endif
/****************************************************************************