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 86e7c460b examples/tcpblaster: fix CMake build with GCC 14
86e7c460b is described below

commit 86e7c460b4e1b3323a09542248ff7bdee8e89221
Author: raiden00pl <[email protected]>
AuthorDate: Wed Oct 7 10:33:37 2026 +0200

    examples/tcpblaster: fix CMake build with GCC 14
    
    With CMake, the tcpblaster host tool is built as part of the NuttX
    build and uses the host C library headers. tcpblaster_server.c calls
    accept4(), which glibc declares only when _GNU_SOURCE is defined, so
    GCC 14 fails with "implicit declaration of function 'accept4'".
    
    Define _GNU_SOURCE for the host tool in tcpblaster_host.cmake. The
    Make build is not affected.
    
    Assisted-by: Claude:claude-opus-5-5
    Signed-off-by: raiden00pl <[email protected]>
---
 examples/tcpblaster/tcpblaster_host.cmake | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/examples/tcpblaster/tcpblaster_host.cmake 
b/examples/tcpblaster/tcpblaster_host.cmake
index 1540fa51f..e0954d31e 100644
--- a/examples/tcpblaster/tcpblaster_host.cmake
+++ b/examples/tcpblaster/tcpblaster_host.cmake
@@ -35,6 +35,10 @@ include_directories(${NUTTX_BINARY_DIR}/include/nuttx)
 
 add_compile_definitions(TCPBLASTER_HOST=1)
 
+# accept4() is a GNU extension in the host C library
+
+add_compile_definitions(_GNU_SOURCE)
+
 if(CONFIG_EXAMPLES_TCPBLASTER_SERVER)
   add_compile_definitions(CONFIG_EXAMPLES_TCPBLASTER_SERVER=1)
   add_compile_definitions(

Reply via email to