Skip to content

Commit 86bce10

Browse files
committed
Fix function prototypes with unspecified arguments
Change functions declared as taking unspecified number of arguments of unspecified type to functions that take no arguments. Reported by kernel's checkpatch.pl script.
1 parent a74c084 commit 86bce10

File tree

6 files changed

+21
-10
lines changed

6 files changed

+21
-10
lines changed

strace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,7 +2319,7 @@ next_event(int *pstatus, siginfo_t *si)
23192319

23202320
/*
23212321
* Used to exit simply when nprocs hits zero, but in this testcase:
2322-
* int main() { _exit(!!fork()); }
2322+
* int main(void) { _exit(!!fork()); }
23232323
* under strace -f, parent sometimes (rarely) manages
23242324
* to exit before we see the first stop of the child,
23252325
* and we are losing track of it:
@@ -2594,7 +2594,7 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
25942594
}
25952595

25962596
#ifdef ENABLE_COVERAGE_GCOV
2597-
extern void __gcov_flush();
2597+
extern void __gcov_flush(void);
25982598
#endif
25992599

26002600
static void ATTRIBUTE_NORETURN

test/mmap_offset_decode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
#define _FILE_OFFSET_BITS 64
2323
#include <sys/mman.h>
2424
#include <errno.h>
25-
int main()
25+
26+
int
27+
main(void)
2628
{
2729
/* 0x1000 is meant to be page size multiplier */
2830
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,

test/mtd.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
#include <sys/ioctl.h>
77
#include <mtd/mtd-user.h>
88

9-
int main() {
9+
int
10+
main(void)
11+
{
1012
int fd = open("/dev/null", 0);
1113
struct mtd_info_user minfo;
1214
struct erase_info_user einfo;

test/sig.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
#include <signal.h>
33
#include <unistd.h>
44

5-
void interrupt()
5+
static void
6+
interrupt(void)
67
{
78
write(2, "xyzzy\n", 6);
89
}
910

10-
int main(int argc, char *argv[])
11+
int
12+
main(int argc, char *argv[])
1113
{
1214
char buf[1024];
1315

test/ubi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99

1010
#define zero(x) memset(&x, 0, sizeof(x))
1111

12-
int main() {
12+
int
13+
main(void)
14+
{
1315
int fd = open("/dev/null", 0);
1416
struct ubi_mkvol_req mkvol = {
1517
.vol_id = 3,

test/wait_must_be_interruptible.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@ static const char msg1[] = "Child signals parent\n";
1818
static const char msg2[] = "Parent got signal\n";
1919
static const char msg3[] = "Child will exit now\n";
2020

21-
static void handler(int s)
21+
static void
22+
handler(int s)
2223
{
2324
write(1, msg2, sizeof(msg2)-1);
2425
}
2526

26-
static void test()
27+
static void
28+
test(void)
2729
{
2830
/* Note: in Linux, signal() installs handler with SA_RESTART flag,
2931
* therefore wait will be restarted.
@@ -45,7 +47,8 @@ static void test()
4547
_exit(0);
4648
}
4749

48-
int main()
50+
int
51+
main(void)
4952
{
5053
char buf1[80];
5154
char buf2[80];

0 commit comments

Comments
 (0)