foo.c: In function 'main':
foo.c:38:30: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
38 | int length1 = strlen(a);
| ^
| |
| int *
In file included from foo.c:2:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int *'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
foo.c:39:30: warning: passing argument 1 of 'strlen' from incompatible pointer type [-Wincompatible-pointer-types]
39 | int length2 = strlen(b);
| ^
| |
| int *
In file included from foo.c:2:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/string.h:407:35: note: expected 'const char *' but argument is of type 'int *'
407 | extern size_t strlen (const char *__s)
| ~~~~~~~~~~~~^~~
foo.c:27:13: warning: unused variable 'n2' [-Wunused-variable]
27 | int n2 = 0;
| ^~
foo.c:38:23: warning: 'a' is used uninitialized [-Wuninitialized]
38 | int length1 = strlen(a);
| ^~~~~~~~~
In file included from foo.c:2:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/string.h:407:15: note: by argument 1 of type 'const char *' to 'strlen' declared here
407 | extern size_t strlen (const char *__s)
| ^~~~~~
foo.c:28:13: note: 'a' declared here
28 | int a[10000];
| ^
foo.c:39:23: warning: 'b' is used uninitialized [-Wuninitialized]
39 | int length2 = strlen(b);
| ^~~~~~~~~
In file included from foo.c:2:
/nix/store/rffag931pvbdiabwwa539wnwg1piqpx0-glibc-2.35-163-dev/include/string.h:407:15: note: by argument 1 of type 'const char *' to 'strlen' declared here
407 | extern size_t strlen (const char *__s)
| ^~~~~~
foo.c:29:13: note: 'b' declared here
29 | int b[10000];
| ^
[Hydro](https://hydro.ac)提供评测服务