Parcourir la source

tests: Fix function signatures

Tibor Nagy il y a 6 ans
Parent
commit
ff874c87d7
100 fichiers modifiés avec 115 ajouts et 118 suppressions
  1. 9 9
      CONTRIBUTING.md
  2. 1 1
      tests/alloca.c
  3. 1 1
      tests/args.c
  4. 1 1
      tests/arpainet.c
  5. 1 1
      tests/assert.c
  6. 1 1
      tests/constructor.c
  7. 1 1
      tests/ctype.c
  8. 1 1
      tests/destructor.c
  9. 1 1
      tests/dirent/main.c
  10. 1 1
      tests/dirent/scandir.c
  11. 1 1
      tests/error.c
  12. 1 1
      tests/fcntl/create.c
  13. 1 1
      tests/fcntl/fcntl.c
  14. 1 1
      tests/fnmatch.c
  15. 3 3
      tests/libgen.c
  16. 1 1
      tests/locale.c
  17. 1 1
      tests/math.c
  18. 1 1
      tests/netdb/netdb.c
  19. 1 1
      tests/pwd.c
  20. 1 1
      tests/regex.c
  21. 1 1
      tests/resource/getrusage.c
  22. 1 1
      tests/select.c
  23. 1 1
      tests/setjmp.c
  24. 1 1
      tests/signal.c
  25. 1 1
      tests/stdio/all.c
  26. 1 1
      tests/stdio/buffer.c
  27. 1 1
      tests/stdio/fgets.c
  28. 1 1
      tests/stdio/fputs.c
  29. 1 1
      tests/stdio/fread.c
  30. 1 1
      tests/stdio/freopen.c
  31. 1 1
      tests/stdio/fseek.c
  32. 1 1
      tests/stdio/fwrite.c
  33. 1 1
      tests/stdio/getc_unget.c
  34. 1 1
      tests/stdio/mutex.c
  35. 1 1
      tests/stdio/popen.c
  36. 1 1
      tests/stdio/printf.c
  37. 1 1
      tests/stdio/rename.c
  38. 1 1
      tests/stdio/scanf.c
  39. 1 1
      tests/stdio/setvbuf.c
  40. 1 1
      tests/stdio/sprintf.c
  41. 1 1
      tests/stdlib/a64l.c
  42. 1 1
      tests/stdlib/alloc.c
  43. 1 1
      tests/stdlib/atof.c
  44. 1 1
      tests/stdlib/atoi.c
  45. 1 1
      tests/stdlib/bsearch.c
  46. 3 4
      tests/stdlib/div.c
  47. 1 1
      tests/stdlib/env.c
  48. 1 1
      tests/stdlib/mkostemps.c
  49. 1 1
      tests/stdlib/mktemp.c
  50. 1 1
      tests/stdlib/rand.c
  51. 1 1
      tests/stdlib/realpath.c
  52. 1 1
      tests/stdlib/strtod.c
  53. 1 1
      tests/stdlib/strtol.c
  54. 1 1
      tests/stdlib/strtoul.c
  55. 1 1
      tests/stdlib/system.c
  56. 1 1
      tests/string/mem.c
  57. 1 1
      tests/string/strcat.c
  58. 1 1
      tests/string/strchr.c
  59. 1 1
      tests/string/strcpy.c
  60. 1 1
      tests/string/strcspn.c
  61. 1 1
      tests/string/strncmp.c
  62. 1 1
      tests/string/strpbrk.c
  63. 1 2
      tests/string/strrchr.c
  64. 1 1
      tests/string/strspn.c
  65. 1 1
      tests/string/strstr.c
  66. 1 1
      tests/string/strtok.c
  67. 1 1
      tests/string/strtok_r.c
  68. 1 1
      tests/strings.c
  69. 1 1
      tests/sys_utsname/uname.c
  70. 1 1
      tests/time/asctime.c
  71. 1 1
      tests/time/gettimeofday.c
  72. 1 1
      tests/time/gmtime.c
  73. 1 1
      tests/time/localtime.c
  74. 1 1
      tests/time/macros.c
  75. 2 1
      tests/time/mktime.c
  76. 2 1
      tests/time/strftime.c
  77. 1 1
      tests/time/time.c
  78. 1 1
      tests/time/times.c
  79. 1 1
      tests/unistd/access.c
  80. 1 1
      tests/unistd/brk.c
  81. 1 1
      tests/unistd/chdir.c
  82. 1 1
      tests/unistd/dup.c
  83. 1 1
      tests/unistd/exec.c
  84. 1 1
      tests/unistd/fchdir.c
  85. 1 1
      tests/unistd/fsync.c
  86. 1 1
      tests/unistd/ftruncate.c
  87. 1 1
      tests/unistd/getcwd.c
  88. 1 1
      tests/unistd/gethostname.c
  89. 1 1
      tests/unistd/getid.c
  90. 1 1
      tests/unistd/isatty.c
  91. 1 1
      tests/unistd/link.c
  92. 1 1
      tests/unistd/pathconf.c
  93. 1 3
      tests/unistd/pipe.c
  94. 1 1
      tests/unistd/rmdir.c
  95. 2 3
      tests/unistd/setid.c
  96. 1 1
      tests/unistd/sleep.c
  97. 1 1
      tests/unistd/stat.c
  98. 1 1
      tests/unistd/sysconf.c
  99. 1 1
      tests/unistd/write.c
  100. 1 1
      tests/waitpid.c

+ 9 - 9
CONTRIBUTING.md

@@ -88,14 +88,14 @@ just in case, it'd be a good idea to map inputs to variables.
 #include "string.h"
 #include "stdio.h"
 
-int main() {
-	// Don't do this
-	printf("%d\n", strcspn("Hello", "Hi"));
-
-	// Do this
-	char *first = "Hello";
-	char *second = "Hi";
-	printf("%d\n", strcspn(first, second));
+int main(void) {
+    // Don't do this
+    printf("%d\n", strcspn("Hello", "Hi"));
+
+    // Do this
+    char *first = "Hello";
+    char *second = "Hi";
+    printf("%d\n", strcspn(first, second));
 }
 ```
 
@@ -120,4 +120,4 @@ You can test against verified correct output with `make verify` in the tests
 directory. You will need to manually create the correct output and put it in the
 tests/expected directory. Running any `make` commands in the tests directory
 will ***not*** rebuild relibc, so you'll need to go back to the root directory
-if you need to rebuild relibc.
+if you need to rebuild relibc.

+ 1 - 1
tests/alloca.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <string.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     char *str = (char *) alloca(17);
 
     memset(str, 'A', 16);

+ 1 - 1
tests/args.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <unistd.h>
 
-int main(int argc, char ** argv) {
+int main(int argc, char *argv[]) {
     int i;
     for(i = 0; i < argc; i++) {
         write(STDOUT_FILENO, argv[i], strlen(argv[i]));

+ 1 - 1
tests/arpainet.c

@@ -3,7 +3,7 @@
 #include <string.h>
 #include <stdlib.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     uint32_t hl = 0xBADFACED;
     uint32_t nl = htonl(hl);
     assert(nl == 0xEDACDFBA);

+ 1 - 1
tests/assert.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main() {
+int main(void) {
     assert(1 == 1);
     assert(1 + 1 == 2);
     puts("yay!");

+ 1 - 1
tests/constructor.c

@@ -16,6 +16,6 @@ TEST(102)
 TEST(103)
 TEST(104)
 
-int main(int argc, char *argv[]) {
+int main(void) {
     puts("main");
 }

+ 1 - 1
tests/ctype.c

@@ -293,7 +293,7 @@ size_t num_test_cases = sizeof(test_cases) / sizeof(struct test_case);
         printf("Unexpected result: " #fn "('%c') != %d // Char value: %d\n", tc.c, tc.fn, tc.c); \
     }
 
-int main(int argc, char* argv[]) {
+int main(void) {
     int retval = 0;
 
     for(int i = 0; i < num_test_cases; ++i) {

+ 1 - 1
tests/destructor.c

@@ -16,6 +16,6 @@ TEST(102)
 TEST(103)
 TEST(104)
 
-int main(int argc, char *argv[]) {
+int main(void) {
     puts("main");
 }

+ 1 - 1
tests/dirent/main.c

@@ -2,7 +2,7 @@
 #include <errno.h>
 #include <stdio.h>
 
-int main() {
+int main(void) {
     printf("%lu\n", sizeof(struct dirent));
 
     DIR* dir = opendir("example_dir/");

+ 1 - 1
tests/dirent/scandir.c

@@ -7,7 +7,7 @@ int filter(const struct dirent* dirent) {
     return strstr(dirent->d_name, "3") == NULL;
 }
 
-int main() {
+int main(void) {
     struct dirent** array;
     int len = scandir("example_dir/", &array, filter, alphasort);
     if (len < 0) {

+ 1 - 1
tests/error.c

@@ -3,7 +3,7 @@
 #include <string.h>
 #include <errno.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     chdir("nonexistent");
     printf("errno: %d = %s\n", errno, strerror(errno));
     perror("perror");

+ 1 - 1
tests/fcntl/create.c

@@ -1,7 +1,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     int fd = creat("create.out", 0755);
     if (fd >= 0) {
         write(fd, "Hello World!\n", 13);

+ 1 - 1
tests/fcntl/fcntl.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     //Lose our fd and pull it again
     creat("fcntl.out", 0777);
     int newfd = open("fcntl.out", 0);

+ 1 - 1
tests/fnmatch.c

@@ -9,7 +9,7 @@ void test(char* pattern, char* input, int flags) {
     }
 }
 
-int main() {
+int main(void) {
     puts("Should succeed:");
     test("*World", "Hello World", 0);
     test("*World", "World", 0);

+ 3 - 3
tests/libgen.c

@@ -18,7 +18,7 @@ char * get_mutable_string(char *str) {
   return copy;
 }
 
-void test_basename() {
+void test_basename(void) {
   test_case test_cases[] =
   { {"/usr/lib", "lib"},
     {"//usr//lib//", "lib"},
@@ -44,7 +44,7 @@ void test_basename() {
   return;
 }
 
-void test_dirname() {
+void test_dirname(void) {
   test_case test_cases[] =
   { {"/usr/lib", "/usr"},
     {"//usr//lib//", "//usr"},
@@ -73,7 +73,7 @@ void test_dirname() {
   return;
 }
 
-int main() {
+int main(void) {
   printf("Testing libgen.h\n");
   test_basename();
   test_dirname();

+ 1 - 1
tests/locale.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <string.h>
 
-int main() {
+int main(void) {
     // TODO: Implement locale properly and test it here
     char* val = setlocale(LC_ALL, NULL);
     if (strcmp(val, "C") == 0) {

+ 1 - 1
tests/math.c

@@ -1,7 +1,7 @@
 #include <math.h>
 #include <stdio.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     double pi = 3.14;
     float c = cos(pi);
     printf("cos(%f) = %f\n", pi, c);

+ 1 - 1
tests/netdb/netdb.c

@@ -225,6 +225,6 @@ do_test (void)
   return (error_count != 0);
 }
 
-int main() {
+int main(void) {
     do_test();
 }

+ 1 - 1
tests/pwd.c

@@ -13,7 +13,7 @@ void print(struct passwd *pwd) {
     printf("pw_shell: %s\n", pwd->pw_shell);
 }
 
-int main() {
+int main(void) {
     puts("--- Checking getpwuid ---");
     errno = 0;
     struct passwd *pwd = getpwuid(0);

+ 1 - 1
tests/regex.c

@@ -1,7 +1,7 @@
 #include <regex.h>
 #include <stdio.h>
 
-int main() {
+int main(void) {
     regex_t regex;
     char error_buf[256];
 

+ 1 - 1
tests/resource/getrusage.c

@@ -6,7 +6,7 @@ void ptimeval(struct timeval* val) {
     printf("{ tv_sec: %ld, tv_usec: %ld }\n", val->tv_sec, val->tv_usec);
 }
 
-int main() {
+int main(void) {
     struct rusage r_usage;
     if (getrusage(RUSAGE_SELF, &r_usage) < 0) {
         perror("getrusage");

+ 1 - 1
tests/select.c

@@ -3,7 +3,7 @@
 #include <sys/select.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     int fd = open("select.c", 0, 0);
 
     fd_set read;

+ 1 - 1
tests/setjmp.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <setjmp.h>
 
-int main() {
+int main(void) {
     jmp_buf buf;
     if (setjmp(buf)) {
         puts("hi from jump");

+ 1 - 1
tests/signal.c

@@ -7,7 +7,7 @@ void handler(int sig) {
     puts("Signal handler called!");
 }
 
-int main() {
+int main(void) {
     if (signal(SIGUSR1, &handler) == SIG_ERR) {
         puts("Signal error!");
         printf("%d\n", errno);

+ 1 - 1
tests/stdio/all.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
 	FILE *f = fopen("stdio/stdio.in", "r");
 	printf("%c\n", fgetc(f));
 	ungetc('H', f);

+ 1 - 1
tests/stdio/buffer.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main() {
+int main(void) {
     // Tests what used to be a bug with buffering
     fwrite("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 1, 999, stdout);
     fwrite("Test\n", 1, 5, stdout);

+ 1 - 1
tests/stdio/fgets.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main() {
+int main(void) {
     //FILE *f = fopen("/etc/ssl/certs/ca-certificates.crt", "r");
     FILE *f = fopen("stdio/stdio.in", "r");
     char line[256];

+ 1 - 1
tests/stdio/fputs.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
 	FILE *f = fopen("stdio/fputs.out", "w");
 	char *in = "Hello World!";
 	fputs(in, f); // calls fwrite, helpers::fwritex, internal::to_write and internal::stdio_write

+ 1 - 1
tests/stdio/fread.c

@@ -1,7 +1,7 @@
 #include <errno.h>
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
     FILE *fp = fopen("stdio/fread.in", "rb");
 
     char buf[33] = { 0 };

+ 1 - 1
tests/stdio/freopen.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
 	freopen("stdio/stdio.in", "r", stdin);
 	char in[6];
 	fgets(in, 6, stdin);

+ 1 - 1
tests/stdio/fseek.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main() {
+int main(void) {
 	FILE *f = fopen("stdio/stdio.in", "r");
     if (fseek(f, 14, SEEK_CUR) < 0) {
         puts("fseek error");

+ 1 - 1
tests/stdio/fwrite.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <errno.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
 	FILE *f = fopen("stdio/fwrite.out", "w");
 	const char ptr[] = "Hello World!";
 

+ 1 - 1
tests/stdio/getc_unget.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
 	ungetc('h', stdin);
 	char c;
 	if ((c = getchar()) == 'h') {

+ 1 - 1
tests/stdio/mutex.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main() {
+int main(void) {
     FILE* f = fopen("stdio/stdio.in", "r");
 
     flockfile(f);

+ 1 - 1
tests/stdio/popen.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char **argv) {
+int main(void) {
     FILE *fp;
     int status;
     char path[256];

+ 1 - 1
tests/stdio/printf.c

@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     int sofar = 0;
     int len = printf(
         "percent: %%\nstring: %s\nchar: %c\nchar: %c\nint: %d\n%nuint: %u\nhex: %x\nHEX: %X\nstring: %s\n",

+ 1 - 1
tests/stdio/rename.c

@@ -8,7 +8,7 @@ static char newpath[] = "new-name.out";
 static char str[] = "Hello, World!";
 int str_len = 13;
 
-int main() {
+int main(void) {
     char buf[14];
     buf[13] = 0x00;
     int fd = creat(oldpath, 0777);

+ 1 - 1
tests/stdio/scanf.c

@@ -25,7 +25,7 @@ void test(char* fmt_in, char* input, struct params *p, ...) {
     );
 }
 
-int main(int argc, char ** argv) {
+int main(void) {
     struct params p = { .c = 'a' };
 
     test("%hhd %d", "12 345", &p, &p.sa, &p.ia);

+ 1 - 1
tests/stdio/setvbuf.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
 	setvbuf(stdout, 0, _IONBF, 0);
 	FILE *f = fopen("stdio/stdio.in", "r");
 	setvbuf(f, 0, _IONBF, 0);

+ 1 - 1
tests/stdio/sprintf.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <string.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     char buffer[72];
 
     int ret = sprintf(

+ 1 - 1
tests/stdlib/a64l.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     char * s = "azAZ9."; // test boundaries
     long l = a64l(s);
     if (l != 194301926) {

+ 1 - 1
tests/stdlib/alloc.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     char * ptr = (char *)malloc(256);
     printf("malloc %p\n", ptr);
     int i;

+ 1 - 1
tests/stdlib/atof.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     double d = atof("-3.14");
     printf("%f\n", d);
     return 0;

+ 1 - 1
tests/stdlib/atoi.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     printf("%d\n", atoi("         -42"));
     printf("%d\n", atoi(" +555"));
     printf("%d\n", atoi("   1234567890    "));

+ 1 - 1
tests/stdlib/bsearch.c

@@ -19,7 +19,7 @@ int int_cmp(const void* a, const void* b) {
 
 
 
-int main(int argc, char* argv[]) {
+int main(void) {
   int x = 0;
   int y = 1024;
 

+ 3 - 4
tests/stdlib/div.c

@@ -3,10 +3,9 @@
          volatile long double ld;
          volatile unsigned long long ll;
          lldiv_t mydivt;
-int
-main ()
-{
-char* tmp;
+
+int main(void) {
+         char* tmp;
          f = strtof("gnu", &tmp);
          ld = strtold("gnu", &tmp);
          ll = strtoll("gnu", &tmp, 10);

+ 1 - 1
tests/stdlib/env.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-int main() {
+int main(void) {
     //puts(getenv("SHELL"));
     //puts(getenv("CC"));
 

+ 1 - 1
tests/stdlib/mkostemps.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <string.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     char* file_name = (char*) calloc(18, sizeof(char));
     strcpy(file_name, "tempXXXXXX.suffix");
     int fd = mkostemps(file_name, 7, 0);

+ 1 - 1
tests/stdlib/mktemp.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <string.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     char* string = (char*) calloc(20, sizeof(char));
     strcpy(string, "tempXXXXXX");
     mktemp(string);

+ 1 - 1
tests/stdlib/rand.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     printf("%d\n", rand());
     srand(259);
     printf("%d\n", rand());

+ 1 - 1
tests/stdlib/realpath.c

@@ -4,7 +4,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-int main() {
+int main(void) {
     char* path = realpath("stdlib/realpath.c", NULL);
     if (!path) {
         perror("realpath");

+ 1 - 1
tests/stdlib/strtod.c

@@ -1,7 +1,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main() {
+int main(void) {
     char* endptr = 0;
     double d;
 

+ 1 - 1
tests/stdlib/strtol.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     printf("%ld\n", strtol("         -42", NULL, 0));
     printf("%ld\n", strtol(" +555", NULL, 0));
     printf("%ld\n", strtol("   1234567890    ", NULL, 0));

+ 1 - 1
tests/stdlib/strtoul.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     printf("%ld\n", strtoul("         -42", NULL, 0));
     printf("%ld\n", strtoul(" +555", NULL, 0));
     printf("%ld\n", strtoul("   1234567890    ", NULL, 0));

+ 1 - 1
tests/stdlib/system.c

@@ -1,6 +1,6 @@
 #include <stdlib.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     system("echo test of system");
     return 0;
 }

+ 1 - 1
tests/string/mem.c

@@ -2,7 +2,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     puts("# mem #");
     char arr[100];
     memset(arr, 0, 100); // Compiler builtin, should work

+ 1 - 1
tests/string/strcat.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     char dest1[12] = "hello";
 	  printf("%s\n", strcat(dest1, " world")); // should be hello world
 

+ 1 - 1
tests/string/strchr.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
 	printf("%s\n", strchr("hello", 'e')); // should be ello
 	printf("%s\n", strchr("world", 'l')); // should be ld
 	printf("%i\n", strchr("world", 0) == NULL); // should be 1

+ 1 - 1
tests/string/strcpy.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <string.h>
 
-int main() {
+int main(void) {
     char dst[20];
 
     strcpy(dst, "strcpy works!");

+ 1 - 1
tests/string/strcspn.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
 	char *world = "world";
 	printf("%ld\n", strcspn("hello", world)); // should be 2
 	printf("%ld\n", strcspn("banana", world)); // should be 6

+ 1 - 1
tests/string/strncmp.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     printf("%d\n", strncmp("a", "aa", 2));
     printf("%d\n", strncmp("a", "aä", 2));
     printf("%d\n", strncmp("\xFF", "\xFE", 2));

+ 1 - 1
tests/string/strpbrk.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     char* source = "The quick drawn fix jumps over the lazy bug";
 
     // should be "The quick drawn fix jumps over the lazy bug"

+ 1 - 2
tests/string/strrchr.c

@@ -1,8 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-
-int main(int argc, char* argv[]) {
+int main(void) {
   char s0[] = "hello, world";
   char* ptr = strrchr(s0, 'l');
   if (ptr != &s0[10]) {

+ 1 - 1
tests/string/strspn.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
 	char *hello = "hello";
 	char *world = "world";
 	char *banana = "banana";

+ 1 - 1
tests/string/strstr.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     printf("%s\n", strstr("In relibc we trust", "rust"));
     printf("%s\n", strstr("In relibc we trust", "libc"));
     printf("%s\n", strstr("In relibc we trust", "bugs"));

+ 1 - 1
tests/string/strtok.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     char source[] = "I'd just like to interject for a moment.  What you're referring to as Linux, "
                     "is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.\n";
 

+ 1 - 1
tests/string/strtok_r.c

@@ -1,7 +1,7 @@
 #include <string.h>
 #include <stdio.h>
 
-int main(int argc, char* argv[]) {
+int main(void) {
     char source[] = "I'd just like to interject for a moment.  What you're referring to as Linux, "
                     "is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.\n";
     char* sp;

+ 1 - 1
tests/strings.c

@@ -3,7 +3,7 @@
 #include <stdio.h>
 #include <strings.h>
 
-int main() {
+int main(void) {
     assert(!bcmp("hello", "hehe", 2));
     assert(bcmp("hello", "haha", 2));
 

+ 1 - 1
tests/sys_utsname/uname.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <sys/utsname.h>
 
-int main() {
+int main(void) {
     struct utsname system_info;
 
     int result = uname(&system_info);

+ 1 - 1
tests/time/asctime.c

@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     time_t a = 0;
     struct tm *time_info = gmtime(&a);
 

+ 1 - 1
tests/time/gettimeofday.c

@@ -1,7 +1,7 @@
 #include <sys/time.h>
 #include <stdio.h>
 
-int main() {
+int main(void) {
     struct timeval tv;
     gettimeofday(&tv, NULL);
     printf("%ld: %ld\n", tv.tv_sec, tv.tv_usec);

+ 1 - 1
tests/time/gmtime.c

@@ -3,7 +3,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     time_t a = 0;
     struct tm expected = { .tm_sec = 0, .tm_min = 0, .tm_hour = 0, .tm_mday = 1, .tm_year = 70,
                     .tm_wday = 4, .tm_yday = 0, .tm_isdst = 0, .tm_gmtoff = 0, .tm_zone = "UTC" };

+ 1 - 1
tests/time/localtime.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <time.h>
 
-int main() {
+int main(void) {
     int day = 60 * 60 * 24;
     time_t inputs[] = { -(day * 33), -day, -1, -500, 0, 1, 1531454950 };
     for (int i = 0; i < (sizeof(inputs) / sizeof(time_t)); i += 1) {

+ 1 - 1
tests/time/macros.c

@@ -1,7 +1,7 @@
 #include <assert.h>
 #include <sys/time.h>
 
-int main() {
+int main(void) {
     struct timeval x = { .tv_usec = 15 };
     struct timeval y = { 0 };
     struct timeval z = { 0 };

+ 2 - 1
tests/time/mktime.c

@@ -18,7 +18,8 @@ int check(time_t input) {
     }
     return 0;
 }
-int main() {
+
+int main(void) {
     struct tm t = { 0 };
 
     t.tm_year = 71;

+ 2 - 1
tests/time/strftime.c

@@ -8,7 +8,8 @@ void print(time_t timestamp, char* fmt) {
     printf("%zu: %s\n", n, out);
     free(out);
 }
-int main() {
+
+int main(void) {
     print(1531808742, "%a %A %b %B");
     print(1531808742, "The %Cst century");
     print(1531808742, "%I:%M:%S %p");

+ 1 - 1
tests/time/time.c

@@ -1,7 +1,7 @@
 #include <time.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     struct timespec tm = {0, 0};
 
     int cgt = clock_gettime(CLOCK_REALTIME, &tm);

+ 1 - 1
tests/time/times.c

@@ -2,7 +2,7 @@
 #include <sys/times.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     struct tms tms;
     printf("return: %ld\n", times(&tms));
 

+ 1 - 1
tests/unistd/access.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     if (access("example_dir/1-never-gonna-give-you-up", R_OK | W_OK)) {
         perror("access");
         return 1;

+ 1 - 1
tests/unistd/brk.c

@@ -1,7 +1,7 @@
 #include <unistd.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     int status = brk((void*)100);
     printf("brk exited with status code %d\n", status);
     return 0;

+ 1 - 1
tests/unistd/chdir.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     char* cwd1 = malloc(4096*sizeof(char));//(char*) calloc(4096 + 1, sizeof(char));
     getcwd(cwd1, 4096);
     printf("initial cwd: %s\n", cwd1);

+ 1 - 1
tests/unistd/dup.c

@@ -2,7 +2,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     creat("dup.out", 0777);
     int fd1 = open("dup.out", 0);
     int fd2 = dup(fd1);

+ 1 - 1
tests/unistd/exec.c

@@ -1,7 +1,7 @@
 #include <unistd.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     char* args[] = {"sh", "-c", "echo 'exec works :D'", NULL};
     execv("/bin/sh", args);
     perror("execv");

+ 1 - 1
tests/unistd/fchdir.c

@@ -2,7 +2,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 
-int main (int argc, char** argv) {
+int main(void) {
     int fd = open("..", 0, 0);
     int status;
     status = fchdir(fd);

+ 1 - 1
tests/unistd/fsync.c

@@ -2,7 +2,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 
-int main (int argc, char** argv) {
+int main(void) {
     int fd = open(".", 0, 0);
     int status;
     status = fsync(fd);

+ 1 - 1
tests/unistd/ftruncate.c

@@ -2,7 +2,7 @@
 #include <fcntl.h>
 #include <stdio.h>
 
-int main (int argc, char** argv) {
+int main(void) {
     int fd = creat("ftruncate.out", 0777);
     int status;
     status = ftruncate(fd, 100);

+ 1 - 1
tests/unistd/getcwd.c

@@ -4,7 +4,7 @@
 #include <string.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     char first[PATH_MAX];
     getcwd(first, PATH_MAX);
     puts(first);

+ 1 - 1
tests/unistd/gethostname.c

@@ -2,7 +2,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     char* hostname = malloc(256);
     if (gethostname(hostname, 256) == 0) {
         printf("Hostname: %s\n", hostname);

+ 1 - 1
tests/unistd/getid.c

@@ -1,7 +1,7 @@
 #include <unistd.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     gid_t egid = getegid();
     uid_t euid = geteuid();
     gid_t gid = getgid();

+ 1 - 1
tests/unistd/isatty.c

@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     // 1 is stdout
     if (isatty(1)) {
         puts("'Tis a tty :D");

+ 1 - 1
tests/unistd/link.c

@@ -3,7 +3,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     printf("%ld\n", sizeof(struct stat));
 
     struct stat buf;

+ 1 - 1
tests/unistd/pathconf.c

@@ -7,7 +7,7 @@
 	printf("%s (%d): %ld (%d)\n", #N, _PC_ ## N, fpathconf(0, _PC_ ## N), errno); \
 }
 
-int main(){
+int main(void) {
 	PC(LINK_MAX);
 	PC(MAX_CANON);
 	PC(MAX_INPUT);

+ 1 - 3
tests/unistd/pipe.c

@@ -3,9 +3,7 @@
 #include <string.h>
 #include <unistd.h>
 
-int main()
-{
-
+int main(void) {
     int pid, pip[2];
     char instring[20];
     char * outstring = "Hello World!";

+ 1 - 1
tests/unistd/rmdir.c

@@ -2,7 +2,7 @@
 #include <sys/stat.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     mkdir("foo", 0);
     int status = rmdir("foo");
     printf("rmdir exited with status code %d\n", status);

+ 2 - 3
tests/unistd/setid.c

@@ -6,8 +6,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-int main( void )
-  {
+int main(void) {
     if( setpgid( getpid(), 0 ) == -1 ) {
         perror( "setpgid" );
     }
@@ -24,4 +23,4 @@ int main( void )
     }
     printf("%d has euid %d and uid %d\n", getpid(), geteuid(), getuid());
     return 0;
-  }
+}

+ 1 - 1
tests/unistd/sleep.c

@@ -2,7 +2,7 @@
 #include <unistd.h>
 #include <stdio.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     sleep(2);
     perror("sleep");
     usleep(1000);

+ 1 - 1
tests/unistd/stat.c

@@ -3,7 +3,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-int main() {
+int main(void) {
     printf("%ld\n", sizeof(struct stat));
 
     struct stat buf;

+ 1 - 1
tests/unistd/sysconf.c

@@ -7,7 +7,7 @@
 	printf("%s (%d): %ld (%d)\n", #N, _SC_ ## N, sysconf(_SC_ ## N), errno); \
 }
 
-int main(){
+int main(void) {
 	SC(ARG_MAX);
 	SC(CHILD_MAX);
 	SC(CLK_TCK);

+ 1 - 1
tests/unistd/write.c

@@ -1,6 +1,6 @@
 #include <unistd.h>
 
-int main(int argc, char ** argv) {
+int main(void) {
     write(STDOUT_FILENO, "Hello World!\n", 13);
     return 0;
 }

+ 1 - 1
tests/waitpid.c

@@ -2,7 +2,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 
-int main(int argc, char** argv) {
+int main(void) {
     pid_t pid = fork();
     if (pid == 0) {
         // child

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff