Skip to content

Commit

Permalink
Glibc 2.33 fix.
Browse files Browse the repository at this point in the history
The library does not declare __fxstatat64 and friends in a header file.
Thus the following warning appears:

```
libsystem.c:333:1: error: no previous prototype for '__xstat' [-Werror=missing-prototypes]
  333 | __xstat (int version, const char *path, struct stat *buf)
      | ^~~~~~~
libsystem.c:342:1: error: no previous prototype for '__xstat64' [-Werror=missing-prototypes]
  342 | __xstat64 (int version, const char *path, struct stat64 *buf)
      | ^~~~~~~~~
libsystem.c:351:1: error: no previous prototype for '__fxstatat' [-Werror=missing-prototypes]
  351 | __fxstatat(int ver, int dirfd, const char *pathname, struct stat *buf, int flags)
      | ^~~~~~~~~~
libsystem.c:360:1: error: no previous prototype for '__fxstatat64' [-Werror=missing-prototypes]
  360 | __fxstatat64(int ver, int dirfd, const char *pathname, struct stat64 *buf, int flags)
      | ^~~~~~~~~~~~
```

Fixed #167.
  • Loading branch information
marxin authored and robert-ancell committed Feb 15, 2021
1 parent 97dc99a commit 270b3bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/libsystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ stat64 (const char *path, struct stat64 *buf)
return _stat64 (new_path, buf);
}

// glibc 2.33 and newer does not declare these functions in a header file
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmissing-prototypes"

int
__xstat (int version, const char *path, struct stat *buf)
{
Expand Down Expand Up @@ -365,6 +369,8 @@ __fxstatat64(int ver, int dirfd, const char *pathname, struct stat64 *buf, int f
return ___fxstatat64 (ver, dirfd, new_path, buf, flags);
}

#pragma GCC diagnostic pop

DIR *
opendir (const char *name)
{
Expand Down

0 comments on commit 270b3bf

Please sign in to comment.