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

incompatible pointer type #1

Open
kiavash-at-work opened this issue Jun 26, 2020 · 1 comment
Open

incompatible pointer type #1

kiavash-at-work opened this issue Jun 26, 2020 · 1 comment

Comments

@kiavash-at-work
Copy link

While compiling the code under Debian Buster, gcc shows these warnings regarding incompatible pointer type passed to sscanf

postpuff.c: In function ‘file_ok_proc’:
postpuff.c:427:12: warning: passing argument 1 of ‘sscanf’ from incompatible pointer type [-Wincompatible-pointer-types]
     sscanf(&buf, "%s %s %s %s %s", tmp[0], tmp[1], tmp[2], tmp[3], tmp[4]);
            ^~~~
In file included from postpuff.c:20:
/usr/include/stdio.h:399:43: note: expected ‘const char * restrict’ but argument is of type ‘char (*)[200]’
 extern int sscanf (const char *__restrict __s,
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
postpuff.c:447:12: warning: passing argument 1 of ‘sscanf’ from incompatible pointer type [-Wincompatible-pointer-types]
     sscanf(&buf,"%lf %lf %lf %lf %lf %lf %lf %lf %lf",
            ^~~~
In file included from postpuff.c:20:
/usr/include/stdio.h:399:43: note: expected ‘const char * restrict’ but argument is of type ‘char (*)[200]’
 extern int sscanf (const char *__restrict __s,
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~
@kiavash-at-work
Copy link
Author

kiavash-at-work commented Jun 29, 2020

Submited Pull request #3 and commint 0bf7f2a.

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

1 participant