Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error #5

Open
schraederb opened this issue Aug 16, 2019 · 1 comment
Open

Compile error #5

schraederb opened this issue Aug 16, 2019 · 1 comment

Comments

@schraederb
Copy link

schraederb commented Aug 16, 2019

When I go to compile I get the following:

g600.c: In function ‘ends_with’:
g600.c:66:25: warning: initialization of ‘size_t’ {aka ‘long unsigned int’} from ‘const char *’ makes integer from pointer without a cast [-Wint-conversion]
size_t haystack_end = haystack + haystack_length - suffix_length;
^~~~~~~~
g600.c:67:26: warning: passing argument 2 of ‘strncmp’ makes pointer from integer without a cast [-Wint-conversion]
return strncmp(suffix, haystack_end, suffix_length) == 0;
^~~~~~~~~~~~
In file included from g600.c:4:
/usr/include/string.h:139:51: note: expected ‘const char *’ but argument is of type ‘size_t’ {aka ‘long unsigned int’}
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
~~~~~~~~~~~~^~~~
g600.c: In function ‘main’:
g600.c:102:30: warning: passing argument 1 of ‘find_g600’ from incompatible pointer type [-Wincompatible-pointer-types]
int find_error = find_g600(&path);
^~~~~
g600.c:71:21: note: expected ‘char ’ but argument is of type ‘char ()[1024]’
int find_g600(char *path) {
~~~~~~^~~~

and then when I try to run the program it acts like it is running fine, but the keys are not changed from the defaults. This could easily be me not doing something correctly, but I appreciate any insight.

@mafik
Copy link
Owner

mafik commented Aug 16, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants