]> granicus.if.org Git - strace/commitdiff
Fix function prototypes with unspecified arguments
authorDmitry V. Levin <ldv@altlinux.org>
Sat, 17 Jun 2017 19:08:36 +0000 (19:08 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 17 Jun 2017 20:49:09 +0000 (20:49 +0000)
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.

strace.c
test/mmap_offset_decode.c
test/mtd.c
test/sig.c
test/ubi.c
test/wait_must_be_interruptible.c

index 3af9e4fb0636e215b3590e67f12d716e019123f2..ba2d695361ea89e44d504ec1939709caec641b29 100644 (file)
--- a/strace.c
+++ b/strace.c
@@ -2319,7 +2319,7 @@ next_event(int *pstatus, siginfo_t *si)
 
        /*
         * Used to exit simply when nprocs hits zero, but in this testcase:
-        *  int main() { _exit(!!fork()); }
+        *  int main(void) { _exit(!!fork()); }
         * under strace -f, parent sometimes (rarely) manages
         * to exit before we see the first stop of the child,
         * and we are losing track of it:
@@ -2594,7 +2594,7 @@ dispatch_event(enum trace_event ret, int *pstatus, siginfo_t *si)
 }
 
 #ifdef ENABLE_COVERAGE_GCOV
-extern void __gcov_flush();
+extern void __gcov_flush(void);
 #endif
 
 static void ATTRIBUTE_NORETURN
index 34a708e22bad64eee2ab26f3a645cd8ff9ffb38c..a2b1c02731dc9b03df0364d62de8eba54dbe7d64 100644 (file)
@@ -22,7 +22,9 @@
 #define _FILE_OFFSET_BITS 64
 #include <sys/mman.h>
 #include <errno.h>
-int main()
+
+int
+main(void)
 {
        /* 0x1000 is meant to be page size multiplier */
        mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
index b9fc69576087db09ccadadcb8edb26f7ed74af44..c8c25ae0837a6f9e3dcc615bb0d3078f41ac6eeb 100644 (file)
@@ -6,7 +6,9 @@
 #include <sys/ioctl.h>
 #include <mtd/mtd-user.h>
 
-int main() {
+int
+main(void)
+{
        int fd = open("/dev/null", 0);
        struct mtd_info_user minfo;
        struct erase_info_user einfo;
index 1678b0227aff78499f1f43e558b21504f06b3ba3..2c1bd45de07ab6758ad27147b9a8fc5500b2df40 100644 (file)
@@ -2,12 +2,14 @@
 #include <signal.h>
 #include <unistd.h>
 
-void interrupt()
+static void
+interrupt(void)
 {
        write(2, "xyzzy\n", 6);
 }
 
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
 {
        char buf[1024];
 
index 5062c836438f65b46a7331d9759a49dafd94da19..774ba58e308be882654815b4b9b8bc9113ae31f2 100644 (file)
@@ -9,7 +9,9 @@
 
 #define zero(x) memset(&x, 0, sizeof(x))
 
-int main() {
+int
+main(void)
+{
        int fd = open("/dev/null", 0);
        struct ubi_mkvol_req mkvol = {
                .vol_id = 3,
index 3fb344977345b3ad25d435a7772979ffbcab95b4..5943a57b36bf543fe2110bcbab31cbf4bd2f16f9 100644 (file)
@@ -18,12 +18,14 @@ static const char msg1[] = "Child signals parent\n";
 static const char msg2[] = "Parent got signal\n";
 static const char msg3[] = "Child will exit now\n";
 
-static void handler(int s)
+static void
+handler(int s)
 {
        write(1, msg2, sizeof(msg2)-1);
 }
 
-static void test()
+static void
+test(void)
 {
        /* Note: in Linux, signal() installs handler with SA_RESTART flag,
         * therefore wait will be restarted.
@@ -45,7 +47,8 @@ static void test()
        _exit(0);
 }
 
-int main()
+int
+main(void)
 {
        char buf1[80];
        char buf2[80];