This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 6ddb2e5304ddb582358903dedc81b16e41e619e6
Author: Marco Casaroli <[email protected]>
AuthorDate: Sat Oct 17 20:12:53 2026 +0200

    Documentation: Describe NUTTX_NO_GETOPT_MACROS and NUTTX_NO_EXTENSIONS.
    
    Add a section to the libc page. It tells which macro a program defines
    to keep which non-standard header names free.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 Documentation/os/libs/libc/index.rst | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/Documentation/os/libs/libc/index.rst 
b/Documentation/os/libs/libc/index.rst
index 2d0e7acd5b4..d779cb73da0 100644
--- a/Documentation/os/libs/libc/index.rst
+++ b/Documentation/os/libs/libc/index.rst
@@ -71,6 +71,26 @@ directory::
 
   misc      - Nonstandard "glue" logic, nuttx/debug.h, crc32.h, dirent.h
 
+Non-standard Names in the Headers
+=================================
+
+Some headers define names for the OS that C and POSIX do not reserve.
+A portable program that uses such a name for its own purpose can define
+one of these macros before its first ``#include``:
+
+``NUTTX_NO_GETOPT_MACROS``
+  ``unistd.h`` does not define ``optarg``, ``opterr``, ``optind`` and
+  ``optopt`` as macros.  getopt() keeps these values per task, so use
+  this only in a program that brings its own getopt() and its own
+  variables of these names.
+
+``NUTTX_NO_EXTENSIONS``
+  The headers do not define ``ERROR`` and ``OK`` (``sys/types.h``),
+  ``set_errno()`` and ``get_errno()`` (``errno.h``), ``zalloc()``
+  (``stdlib.h``), ``O_TEXT`` (``fcntl.h``), ``weak_alias``,
+  ``visibility_hidden``, ``visibility_default`` and ``unused_data``
+  (``nuttx/compiler.h``).
+
 Library Database
 ================
 

Reply via email to