Skip to content

With gcc 14.2.1, build fails with -Wimplicit-function-declaration and -Wincompatible-pointer-types #6

@dreirund

Description

@dreirund

With gcc 14.2.1, build fails with -Wimplicit-function-declaration and -Wincompatible-pointer-types:

In file included from osdep.c:31:
env_unix.c: In function ‘lock_work’:
osdep.h:60:15: error: implicit declaration of function ‘safe_flock’ [-Wimplicit-function-declaration]
   60 | #define flock safe_flock
      |               ^~~~~~~~~~
news.c: In function ‘news_open’:
news.c:370:36: error: passing argument 3 of ‘scandir’ from incompatible pointer type [-Wincompatible-pointer-types]
  370 |   if ((nmsgs = scandir (tmp,&names,news_select,news_numsort)) >= 0) {
      |                                    ^~~~~~~~~~~
      |                                    |
      |                                    int (*)(struct dirent *)
In file included from osdep.h:47,
                 from news.c:35:
/usr/include/dirent.h:259:27: note: expected ‘int (*)(const struct dirent *)’ but argument is of type ‘int (*)(struct dirent *)’
  259 |                     int (*__selector) (const struct dirent *),
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
news.c:370:48: error: passing argument 4 of ‘scandir’ from incompatible pointer type [-Wincompatible-pointer-types]
  370 |   if ((nmsgs = scandir (tmp,&names,news_select,news_numsort)) >= 0) {
      |                                                ^~~~~~~~~~~~
      |                                                |
      |                                                int (*)(const void *, const void *)
/usr/include/dirent.h:260:27: note: expected ‘int (*)(const struct dirent **, const struct dirent **)’ but argument is of type ‘int (*)(const void *, const void *)’
  260 |                     int (*__cmp) (const struct dirent **,
      |                     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  261 |                                   const struct dirent **))
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~

Regards!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions