Skip to content

incompatible pointer type #1

@ghost

Description

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,
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions