]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: Remove ioperm declare as it causes nested extern declare warning
authorZhaoming Luo <zhmingluo@163.com>
Mon, 9 Dec 2024 02:11:54 +0000 (10:11 +0800)
committerKarel Zak <kzak@redhat.com>
Mon, 9 Dec 2024 10:42:18 +0000 (11:42 +0100)
The extern declaration causes the following warning:

```
  CC       sys-utils/hwclock-hwclock-cmos.o
sys-utils/hwclock-cmos.c: In function 'i386_iopl':
sys-utils/hwclock-cmos.c:356:20: warning: nested extern declaration of 'ioperm' [-Wnested-externs]
  356 |         extern int ioperm(unsigned long from, unsigned long num, int turn_on);
      |                    ^~~~~~
sys-utils/hwclock-cmos.c:356:20: warning: redundant redeclaration of 'ioperm' [-Wredundant-decls]
In file included from sys-utils/hwclock-cmos.c:68:
/usr/include/i386-gnu/sys/io.h:29:12: note: previous declaration of 'ioperm' with type 'int(long unsigned int,  long unsigned int,  int)'
   29 | extern int ioperm (unsigned long int __from, unsigned long int __num,
      |            ^~~~~~
  CCLD     hwclock
```

sys-utils/hwclock-cmos.c

index 7e5eecc7dcee839e9dd588ba1dcd5924c13ca863..c7f82437dff667511665adbc97eaed1aaf5fd1a5 100644 (file)
@@ -352,7 +352,6 @@ static int i386_iopl(const int level)
 # else
 static int i386_iopl(const int level __attribute__ ((__unused__)))
 {
-       extern int ioperm(unsigned long from, unsigned long num, int turn_on);
        return ioperm(clock_ctl_addr, 2, 1);
 }
 # endif