-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Open
Copy link
Labels
area: C LibraryC Standard LibraryC Standard Libraryarea: Minimal libcMinimal C Standard LibraryMinimal C Standard LibrarybugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bugMedium impact/importance bug
Description
Describe the bug
The minimal libc is missing isblank() (C99), islower() (C89), and ispunct() (C89).
Regression
- This is a regression.
Steps to reproduce
- apply the following diff
diff --git a/samples/hello_world/src/main.c b/samples/hello_world/src/main.c
index c550ab461cb..d0f1f87de30 100644
--- a/samples/hello_world/src/main.c
+++ b/samples/hello_world/src/main.c
@@ -4,11 +4,12 @@
* SPDX-License-Identifier: Apache-2.0
*/
+#include <ctype.h>
#include <stdio.h>
int main(void)
{
printf("Hello World! %s\n", CONFIG_BOARD_TARGET);
- return 0;
+ return isblank('x') || islower('X') || ispunct('x');
}west build -p auto -b qemu_riscv64 samples/hello_world -- -DCONFIG_MINIMAL_LIBC=y -DCONFIG_COMPILER_WARNINGS_AS_ERRORS=y- See error
Relevant log output
ZEPHYR_BASE/samples/hello_world/src/main.c:14:16: error: implicit declaration of function 'isblank' [-Werror=implicit-function-declaration]
14 | return isblank('x') || islower('X') || ispunct('x');
| ^~~~~~~
ZEPHYR_BASE/samples/hello_world/src/main.c:14:32: error: implicit declaration of function 'islower'; did you mean 'tolower'? [-Werror=implicit-function-declaration]
14 | return isblank('x') || islower('X') || ispunct('x');
| ^~~~~~~
| tolower
ZEPHYR_BASE/samples/hello_world/src/main.c:14:48: error: implicit declaration of function 'ispunct' [-Werror=implicit-function-declaration]
14 | return isblank('x') || islower('X') || ispunct('x');
| ^~~~Impact
Major – Severely degrades functionality; workaround is difficult or unavailable.
Environment
- OS: any
- Toolchain: Zephyr SDK v0.17.4
- Commit SHA or Version used:
v4.3.0
Additional Context
Metadata
Metadata
Assignees
Labels
area: C LibraryC Standard LibraryC Standard Libraryarea: Minimal libcMinimal C Standard LibraryMinimal C Standard LibrarybugThe issue is a bug, or the PR is fixing a bugThe issue is a bug, or the PR is fixing a bugpriority: mediumMedium impact/importance bugMedium impact/importance bug