Issue 242526
Summary [libc] Implement POSIX getsubopt in <stdlib.h>
Labels libc
Assignees
Reporter amanmaurya92
    ### Feature Request

POSIX.1-2024 specifies \getsubopt\ in \<stdlib.h>\ to parse suboption arguments from a comma-separated option string (commonly used in CLI argument parsing alongside \getopt\).

- Standard reference: POSIX.1-2024 (IEEE Std 1003.1-2024), \getsubopt()\.
- Signature:
 \\\c
  int getsubopt(char **optionp, char *const *tokens, char **valuep);
  \\\`n
LLVM libc has \getopt\, but lacks \getsubopt\. We plan to implement \getsubopt\ in \libc/src/stdlib\ with unit tests covering token matching, key-value extraction, empty suboptions, and unmatched tokens.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to