Skip to content

Commit

Permalink
Fix warning about conflicting lseek/lseek64 prototypes
Browse files Browse the repository at this point in the history
Clang rightfully complains about conflicting prototypes, as both lseek() variants
are redefined:

  syscall.c:394:10: warning: a function declaration without a prototype is deprecated
  in all versions of C and is treated as a zero-parameter prototype in C2x, conflicting
  with a previous declaration [-Wdeprecated-non-prototype]
        off64_t lseek64();
                ^
/usr/include/unistd.h:350:18: note: conflicting prototype is here
extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence)
                 ^
1 warning generated.

The point of the #ifdef is to build for the configured OFF_T; there is
no reason to redefine lseek/lseek64, which should have been found
via configure.

Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
  • Loading branch information
hhoffstaette authored and WayneD committed Nov 20, 2024
1 parent e55b190 commit 0706988
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,11 +388,6 @@ int do_fstat(int fd, STRUCT_STAT *st)
OFF_T do_lseek(int fd, OFF_T offset, int whence)
{
#ifdef HAVE_LSEEK64
#if !SIZEOF_OFF64_T
OFF_T lseek64();
#else
off64_t lseek64();
#endif
return lseek64(fd, offset, whence);
#else
return lseek(fd, offset, whence);
Expand Down

0 comments on commit 0706988

Please sign in to comment.