-
-
Notifications
You must be signed in to change notification settings - Fork 698
Closed
Labels
medium severityUsed to report medium severity bugs (e.g. Malfunctioning Features but still useable)Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)
Description
Contact Details
What happened?
cosmoplitian libc strcasestr() return 0 for below example
#ifdef __COSMOPOLITIAN__
#include <libc/str/str.h>
#endif
#include <stdio.h>
int main() {
printf("strcasestr(\"Windows\", \"win\") = %llu", strcasestr("Windows", "win"));
}
Version
cosmocc (GCC) 14.1.0
What operating system are you seeing the problem on?
both on x86_64 windows/linux
Relevant log output
(venv) ➜ backend git:(fastdev) ✗ $CC -D_COSMO_SOURCE testb.c -o testb
(venv) ➜ backend git:(fastdev) ✗ ./testb
strcasestr("Windows", "win") = 0%
(venv) ➜ backend git:(fastdev) ✗ cc testb.c -o testb
testb.c: In function ‘main’:
testb.c:7:53: warning: implicit declaration of function ‘strcasestr’ [-Wimplicit-function-declaration]
7 | printf("strcasestr(\"Windows\", \"win\") = %llu", strcasestr("Windows", "win"));
| ^~~~~~~~~~
(venv) ➜ backend git:(fastdev) ✗ ./testb
strcasestr("Windows", "win") = 3786059788%
note $CC refers cosmocc
Metadata
Metadata
Assignees
Labels
medium severityUsed to report medium severity bugs (e.g. Malfunctioning Features but still useable)Used to report medium severity bugs (e.g. Malfunctioning Features but still useable)