-
Notifications
You must be signed in to change notification settings - Fork 8k
Open
Labels
area: native portHost native arch port (native_sim)Host native arch port (native_sim)bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bugLow impact/importance bug
Description
Describe the bug
On native posix platforms, the whole zephyr/lib/posix/
subdirectory is ignored if building natively:
if(NOT CONFIG_NATIVE_LIBC)
add_subdirectory(posix)
endif()
This includes the zephyr/lib/posix/options/getopt
subdirectory which implements a non-standard (?) getopt interface, including the structure struct getopt_state
, which is referenced when CONFIG_SHELL_GETOPT=y
is enabled, generating errors like:
/home/jaagup/projects/forest/zephyr/include/zephyr/shell/shell.h:867:22: error: field has incomplete type 'struct getopt_state'
867 | struct getopt_state getopt;
| ^
/home/jaagup/projects/forest/zephyr/include/zephyr/shell/shell.h:867:9: note: forward declaration of 'struct getopt_state'
867 | struct getopt_state getopt;
|
On native posix, the system <getopt.h> is included, which does not define this structure.
I am open to making a PR with some direction of how best work around this conflict.
Regression
- This is a regression.
Steps to reproduce
No response
Relevant log output
Impact
Annoyance – Minor irritation; no significant impact on usability or functionality.
Environment
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
area: native portHost native arch port (native_sim)Host native arch port (native_sim)bugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bugLow impact/importance bug