Make all C main functions without arguments have "void" in arg list.

pull/6193/head
Jussi Pakkanen 5 years ago
parent bf800101c2
commit f6ad5d1398
  1. 2
      test cases/common/1 trivial/trivial.c
  2. 2
      test cases/common/100 stringdef/stringdef.c
  3. 2
      test cases/common/102 subproject subdir/prog.c
  4. 2
      test cases/common/103 postconf/prog.c
  5. 2
      test cases/common/104 postconf with args/prog.c
  6. 2
      test cases/common/106 extract same name/main.c
  7. 2
      test cases/common/109 generatorcustom/main.c
  8. 2
      test cases/common/11 subdir/subdir/prog.c
  9. 2
      test cases/common/111 spaces backslash/comparer-end-notstring.c
  10. 2
      test cases/common/111 spaces backslash/comparer-end.c
  11. 2
      test cases/common/111 spaces backslash/comparer.c
  12. 2
      test cases/common/116 subdir subproject/prog/prog.c
  13. 2
      test cases/common/119 subproject project arguments/exe.c
  14. 2
      test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c
  15. 2
      test cases/common/120 test skip/test_skip.c
  16. 2
      test cases/common/122 llvm ir and assembly/main.c
  17. 2
      test cases/common/124 extract all shared library/prog.c
  18. 2
      test cases/common/125 object only target/prog.c
  19. 2
      test cases/common/126 no buildincdir/prog.c
  20. 2
      test cases/common/128 dependency file generation/main .c
  21. 2
      test cases/common/129 configure file in generator/src/main.c
  22. 2
      test cases/common/13 pch/c/prog.c
  23. 2
      test cases/common/13 pch/generated/prog.c
  24. 2
      test cases/common/13 pch/userDefined/prog.c
  25. 2
      test cases/common/13 pch/withIncludeDirectories/prog.c
  26. 2
      test cases/common/130 generated llvm ir/main.c
  27. 2
      test cases/common/131 generated assembly/main.c
  28. 2
      test cases/common/132 build by default targets in tests/main.c
  29. 2
      test cases/common/133 build by default/foo.c
  30. 2
      test cases/common/134 include order/ordertest.c
  31. 2
      test cases/common/134 include order/sub4/main.c
  32. 2
      test cases/common/135 override options/four.c
  33. 2
      test cases/common/135 override options/two.c
  34. 2
      test cases/common/137 c cpp and asm/main.c
  35. 2
      test cases/common/139 custom target object output/progdir/prog.c
  36. 2
      test cases/common/14 configure file/dumpprog.c
  37. 2
      test cases/common/14 configure file/prog.c
  38. 2
      test cases/common/14 configure file/prog2.c
  39. 2
      test cases/common/14 configure file/prog4.c
  40. 2
      test cases/common/14 configure file/prog5.c
  41. 2
      test cases/common/14 configure file/prog6.c
  42. 2
      test cases/common/14 configure file/prog7.c
  43. 2
      test cases/common/14 configure file/prog9.c
  44. 2
      test cases/common/141 whole archive/prog.c
  45. 2
      test cases/common/146 nested links/xephyr.c
  46. 2
      test cases/common/148 link depends custom target/foo.c
  47. 2
      test cases/common/149 recursive linking/circular/main.c
  48. 2
      test cases/common/149 recursive linking/edge-cases/shstmain.c
  49. 2
      test cases/common/149 recursive linking/edge-cases/stomain.c
  50. 2
      test cases/common/149 recursive linking/main.c
  51. 2
      test cases/common/15 if/prog.c
  52. 2
      test cases/common/150 library at root/main/main.c
  53. 2
      test cases/common/151 simd/simdchecker.c
  54. 2
      test cases/common/153 dotinclude/dotproc.c
  55. 2
      test cases/common/154 reserved targets/test.c
  56. 2
      test cases/common/155 duplicate source names/dir1/file.c
  57. 2
      test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c
  58. 2
      test cases/common/157 wrap file should not failed/src/subprojects/prog.c
  59. 3
      test cases/common/158 includedir subproj/prog.c
  60. 2
      test cases/common/159 subproject dir name collision/a.c
  61. 2
      test cases/common/16 else/prog.c
  62. 2
      test cases/common/17 comparison/prog.c
  63. 2
      test cases/common/170 get project license/bar.c
  64. 2
      test cases/common/172 subproject nested subproject dirs/prog.c
  65. 2
      test cases/common/173 preserve gendir/testprog.c
  66. 2
      test cases/common/174 source in dep/generated/main.c
  67. 2
      test cases/common/175 generator link whole/main.c
  68. 2
      test cases/common/18 array/prog.c
  69. 2
      test cases/common/183 bothlibraries/main.c
  70. 2
      test cases/common/184 escape and unicode/main.c
  71. 2
      test cases/common/187 find override/otherdir/main.c
  72. 2
      test cases/common/187 find override/otherdir/main2.c
  73. 2
      test cases/common/188 partial dependency/declare_dependency/main.c
  74. 2
      test cases/common/19 includedir/src/prog.c
  75. 2
      test cases/common/195 install_mode/trivial.c
  76. 2
      test cases/common/20 header in file list/prog.c
  77. 2
      test cases/common/200 generator in subdir/com/mesonbuild/testprog.c
  78. 2
      test cases/common/202 subproject with features/nothing.c
  79. 2
      test cases/common/207 kwarg entry/prog.c
  80. 2
      test cases/common/215 link custom/prog.c
  81. 2
      test cases/common/216 link custom_i single from multiple/prog.c
  82. 2
      test cases/common/217 link custom_i multiple from multiple/prog.c
  83. 2
      test cases/common/225 include_dir dot/src/main.c
  84. 2
      test cases/common/23 object extraction/main.c
  85. 2
      test cases/common/24 endian/prog.c
  86. 2
      test cases/common/26 config subdir/src/prog.c
  87. 2
      test cases/common/27 pipeline/depends/prog.c
  88. 2
      test cases/common/27 pipeline/prog.c
  89. 2
      test cases/common/27 pipeline/src/prog.c
  90. 2
      test cases/common/33 define10/prog.c
  91. 3
      test cases/common/36 tryrun/ok.c
  92. 2
      test cases/common/42 library chain/main.c
  93. 2
      test cases/common/44 test args/env2vars.c
  94. 2
      test cases/common/44 test args/envvars.c
  95. 2
      test cases/common/45 subproject/subprojects/sublib/simpletest.c
  96. 2
      test cases/common/45 subproject/user.c
  97. 2
      test cases/common/48 custom install dirs/prog.c
  98. 2
      test cases/common/49 subproject subproject/prog.c
  99. 2
      test cases/common/5 linkstatic/main.c
  100. 2
      test cases/common/50 same file name/prog.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -1,6 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("Trivial test is working.\n");
return 0;
}

@ -1,7 +1,7 @@
#include<stdio.h>
#include<string.h>
int main() {
int main(void) {
if(strcmp(FOO, "bar")) {
printf("FOO is misquoted: %s\n", FOO);
return 1;

@ -1,5 +1,5 @@
#include <sub.h>
int main() {
int main(void) {
return sub();
}

@ -1,5 +1,5 @@
#include"generated.h"
int main() {
int main(void) {
return THE_NUMBER != 9;
}

@ -1,5 +1,5 @@
#include"generated.h"
int main() {
int main(void) {
return THE_NUMBER != 9 || THE_ARG1 != 5 || THE_ARG2 != 33;
}

@ -1,6 +1,6 @@
int func1();
int func2();
int main() {
int main(void) {
return !(func1() == 23 && func2() == 42);
}

@ -2,6 +2,6 @@
#include"alltogether.h"
int main() {
int main(void) {
return 0;
}

@ -1 +1 @@
int main() { return 0; }
int main(void) { return 0; }

@ -10,7 +10,7 @@
#define COMPARE_WITH "foo\\bar\\" /* This is the literal `foo\bar\` */
int main() {
int main(void) {
if(strcmp(QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH)) {
printf("Arg string is quoted incorrectly: %s instead of %s\n",
QUOTE(DEF_WITH_BACKSLASH), COMPARE_WITH);

@ -6,7 +6,7 @@
#define COMPARE_WITH "foo\\bar\\" /* This is `foo\bar\` */
int main () {
int main(void) {
if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) {
printf ("Arg string is quoted incorrectly: %s vs %s\n",
DEF_WITH_BACKSLASH, COMPARE_WITH);

@ -6,7 +6,7 @@
#define COMPARE_WITH "foo\\bar" /* This is the literal `foo\bar` */
int main () {
int main(void) {
if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) {
printf ("Arg string is quoted incorrectly: %s instead of %s\n",
DEF_WITH_BACKSLASH, COMPARE_WITH);

@ -1,5 +1,5 @@
#include <sub.h>
int main() {
int main(void) {
return sub();
}

@ -22,6 +22,6 @@
#error
#endif
int main() {
int main(void) {
return 0;
}

@ -22,6 +22,6 @@
#error
#endif
int main() {
int main(void) {
return 0;
}

@ -1,3 +1,3 @@
int main() {
int main(void) {
return 77;
}

@ -2,7 +2,7 @@
unsigned square_unsigned (unsigned a);
int main ()
int main(void)
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -1,7 +1,7 @@
#include"extractor.h"
#include<stdio.h>
int main() {
int main(void) {
if((1+2+3+4) != (func1() + func2() + func3() + func4())) {
printf("Arithmetic is fail.\n");
return 1;

@ -2,6 +2,6 @@ int func1_in_obj();
int func2_in_obj();
int func3_in_obj();
int main() {
int main(void) {
return func1_in_obj() + func2_in_obj() + func3_in_obj();
}

@ -1,5 +1,5 @@
#include"header.h"
int main() {
int main(void) {
return 0;
}

@ -1,3 +1,3 @@
int main() {
int main(void) {
return 0;
}

@ -12,6 +12,6 @@
#error Source RESULT is not defined correctly
#endif
int main() {
int main(void) {
return 0;
}

@ -4,7 +4,7 @@ void func() {
fprintf(stdout, "This is a function that fails if stdio is not #included.\n");
}
int main() {
int main(void) {
return 0;
}

@ -1,6 +1,6 @@
// No includes here, they need to come from the PCH
int main() {
int main(void) {
return FOO + BAR;
}

@ -1,6 +1,6 @@
// No includes here, they need to come from the PCH
int main() {
int main(void) {
// Method is implemented in pch.c.
// This makes sure that we can properly handle user defined
// pch implementation files and not only auto-generated ones.

@ -4,7 +4,7 @@ void func() {
fprintf(stdout, "This is a function that fails if stdio is not #included.\n");
}
int main() {
int main(void) {
return 0;
}

@ -2,7 +2,7 @@
unsigned square_unsigned (unsigned a);
int main ()
int main(void)
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -5,7 +5,7 @@
#endif
unsigned square_unsigned (unsigned a);
int main ()
int main(void)
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -1,3 +1,3 @@
int main () {
int main(void) {
return 0;
}

@ -1,6 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("Existentialism.\n");
return 0;
}

@ -4,7 +4,7 @@
#error "Should have picked up hdr.h from inc1/hdr.h"
#endif
int main ()
int main(void)
{
return 0;
}

@ -1,7 +1,7 @@
/* Use the <> include notation to force searching in include directories */
#include <main.h>
int main() {
int main(void) {
if (somefunc() == 1984)
return 0;
return 1;

@ -4,6 +4,6 @@ static int duplicate_func() {
return -4;
}
int main() {
int main(void) {
return duplicate_func() + func();
}

@ -1,6 +1,6 @@
/*
* Requires a Unity build. Otherwise hidden_func is not specified.
*/
int main() {
int main(void) {
return hidden_func();
}

@ -2,7 +2,7 @@
int get_retval(void);
int main() {
int main(void) {
printf("C seems to be working.\n");
return get_retval();
}

@ -1,5 +1,5 @@
int func1_in_obj();
int main() {
int main(void) {
return func1_in_obj();
}

@ -15,7 +15,7 @@
#define stringify(s) str(s)
#define str(s) #s
int main() {
int main(void) {
#if !(SHOULD_BE_UNQUOTED_STRING == string)
printf("String token (unquoted) defined wrong.\n");
return 1;

@ -8,7 +8,7 @@
#error "FAIL!"
#endif
int main() {
int main(void) {
#ifndef BE_TRUE
return 1;
#else

@ -1,5 +1,5 @@
#include<config2.h>
int main() {
int main(void) {
return ZERO_RESULT;
}

@ -1,6 +1,6 @@
#include <config4a.h>
#include <config4b.h>
int main() {
int main(void) {
return RESULTA + RESULTB;
}

@ -1,6 +1,6 @@
#include <string.h>
#include <config5.h>
int main() {
int main(void) {
return strcmp(MESSAGE, "@var2@");
}

@ -1,7 +1,7 @@
#include <string.h>
#include <config6.h>
int main() {
int main(void) {
return strcmp(MESSAGE1, "foo")
|| strcmp(MESSAGE2, "@var1@")
|| strcmp(MESSAGE3, "\\foo")

@ -1,7 +1,7 @@
#include <string.h>
#include <config7.h>
int main() {
int main(void) {
return strcmp(MESSAGE1, "foo")
|| strcmp(MESSAGE2, "${var1}")
|| strcmp(MESSAGE3, "\\foo")

@ -10,7 +10,7 @@
#error "Should be defined"
#endif
int main() {
int main(void) {
return strcmp(A_STRING, "foo")
|| strcmp(B_STRING, "foo")
|| A_INT != 42

@ -1,5 +1,5 @@
#include<mylib.h>
int main() {
int main(void) {
return func1() - func2();
}

@ -1,3 +1,3 @@
int main() {
int main(void) {
return 0;
}

@ -1,6 +1,6 @@
#include <stdio.h>
int main() {
int main(void) {
const char *fn = DEPFILE;
FILE *f = fopen(fn, "r");
if (!f) {

@ -6,7 +6,7 @@ int get_st1_value (void);
int get_st2_value (void);
int get_st3_value (void);
int main() {
int main(void) {
int val;
val = get_st1_value ();

@ -4,7 +4,7 @@
int get_stshdep_value (void);
int main() {
int main(void) {
int val;
val = get_stshdep_value ();

@ -4,7 +4,7 @@
int get_stodep_value (void);
int main() {
int main(void) {
int val;
val = get_stodep_value ();

@ -9,7 +9,7 @@ SYMBOL_IMPORT int get_shnodep_value (void);
SYMBOL_IMPORT int get_shshdep_value (void);
SYMBOL_IMPORT int get_shstdep_value (void);
int main() {
int main(void) {
int val;
val = get_shnodep_value ();

@ -1 +1 @@
int main() { return 0; }
int main(void) { return 0; }

@ -1,5 +1,5 @@
extern int fn(void);
int main() {
int main(void) {
return 1 + fn();
}

@ -23,7 +23,7 @@ int check_simd_implementation(float *four,
return rv;
}
int main() {
int main(void) {
static const float four_initial[4] = {2.0, 3.0, 4.0, 5.0};
ALIGN_16 float four[4];
const float expected[4] = {3.0, 4.0, 5.0, 6.0};

@ -4,7 +4,7 @@
#error The wrapper stdio.h was not included.
#endif
int main() {
int main(void) {
printf("Eventually I got printed.\n");
return 0;
}

@ -1,3 +1,3 @@
int main() {
int main(void) {
return 0;
}

@ -3,7 +3,7 @@ extern int dir2_dir1;
extern int dir3;
extern int dir3_dir1;
int main() {
int main(void) {
if (dir2 != 20)
return 1;
if (dir2_dir1 != 21)

@ -1,6 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("Do not have a file layout like this in your own projects.\n");
printf("This is only to test that this works.\n");
return 0;

@ -1,6 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("Do not have a file layout like this in your own projects.\n");
printf("This is only to test that this works.\n");
return 0;

@ -1,4 +1,3 @@
int main() {
int main(void) {
return 0;
}

@ -2,7 +2,7 @@
char func_b();
char func_c();
int main() {
int main(void) {
if(func_b() != 'b') {
return 1;
}

@ -1 +1 @@
int main() { return 0; }
int main(void) { return 0; }

@ -1 +1 @@
int main() { return 0; }
int main(void) { return 0; }

@ -1,6 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("I'm a main project bar.\n");
return 0;
}

@ -1,5 +1,5 @@
int func();
int main() {
int main(void) {
return func() == 42 ? 0 : 1;
}

@ -1,6 +1,6 @@
#include"base.h"
#include"com/mesonbuild/subbie.h"
int main() {
int main(void) {
return base() + subbie();
}

@ -1,5 +1,5 @@
#include"funheader.h"
int main() {
int main(void) {
return my_wonderful_function() != 42;
}

@ -2,7 +2,7 @@
#include <stdio.h>
int main() {
int main(void) {
if (meson_test_function() != 19) {
printf("Bad meson_test_function()\n");
return 1;

@ -1,3 +1,3 @@
extern int func();
int main() { return func(); }
int main(void) { return func(); }

@ -3,6 +3,6 @@
DO_IMPORT int func();
DO_IMPORT int retval;
int main() {
int main(void) {
return func() == retval ? 0 : 1;
}

@ -4,7 +4,7 @@ const char* does_it_work();
int a_fun();
int main() {
int main(void) {
if(strcmp(does_it_work(), "yes it does") != 0) {
return -a_fun();
}

@ -1,5 +1,5 @@
int be_seeing_you();
int main() {
int main(void) {
return be_seeing_you() == 6 ? 0 : 1;
}

@ -1,5 +1,5 @@
int number_returner();
int main() {
int main(void) {
return number_returner() == 100 ? 0 : 1;
}

@ -15,7 +15,7 @@
#include "foo.h"
int main() {
int main(void) {
int a = foo();
if (a == 1) {
return 0;

@ -1,5 +1,5 @@
#include "func.h"
int main() {
int main(void) {
return func();
}

@ -1,6 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("Trivial test is working.\n");
return 0;
}

@ -1,3 +1,3 @@
#include "header.h"
int main() { return 0; }
int main(void) { return 0; }

@ -1,5 +1,5 @@
#include"subbie.h"
int main() {
int main(void) {
return subbie();
}

@ -1,4 +1,4 @@
int main()
int main(void)
{
return 0;
}

@ -1,7 +1,7 @@
#include<prog.h>
#include<stdio.h>
int main() {
int main(void) {
printf(MESSAGE);
return 0;
}

@ -1,6 +1,6 @@
void flob();
int main() {
int main(void) {
flob();
return 0;
}

@ -1,5 +1,5 @@
int flob();
int main() {
int main(void) {
return (flob() == 1 ? 0 : 1);
}

@ -1,7 +1,7 @@
void flob_1();
void flob_2();
int main() {
int main(void) {
flob_1();
flob_2();
return 0;

@ -1,5 +1,5 @@
#include "rone.h"
int main() {
int main(void) {
return rOne();
}

@ -1,5 +1,5 @@
int func();
int main() {
int main(void) {
return func() == 42 ? 0 : 1;
}

@ -8,7 +8,7 @@ int is_big_endian(void) {
}
int main() {
int main(void) {
int is_be_check = is_big_endian();
int is_be;
#ifdef IS_BE

@ -1,5 +1,5 @@
#include "config.h"
int main() {
int main(void) {
return RETURN_VALUE;
}

@ -1,5 +1,5 @@
int func();
int main() {
int main(void) {
return func() != 42;
}

@ -1,5 +1,5 @@
int func();
int main() {
int main(void) {
return func();
}

@ -1,6 +1,6 @@
#include"input_src.h"
int main() {
int main(void) {
void *foo = printf;
if(foo) {
return 0;

@ -1,7 +1,7 @@
#include<stdio.h>
#include"config.h"
int main() {
int main(void) {
if(ONE != 1) {
fprintf(stderr, "ONE is not 1.\n");
return 1;

@ -1,5 +1,6 @@
#include<stdio.h>
int main() {
int main(void) {
printf("%s\n", "stdout");
fprintf(stderr, "%s\n", "stderr");
return 0;

@ -1,5 +1,5 @@
int libfun();
int main() {
int main(void) {
return libfun();
}

@ -2,7 +2,7 @@
#include<string.h>
#include<stdlib.h>
int main() {
int main(void) {
if(strcmp(getenv("first"), "something-else") != 0) {
fprintf(stderr, "First envvar is wrong. %s\n", getenv("first"));
return 1;

@ -2,7 +2,7 @@
#include<string.h>
#include<stdlib.h>
int main() {
int main(void) {
if(strcmp(getenv("first"), "val1") != 0) {
fprintf(stderr, "First envvar is wrong. %s\n", getenv("first"));
return 1;

@ -1,5 +1,5 @@
#include<subdefs.h>
int main() {
int main(void) {
return subfunc() == 42 ? 0 : 1;
}

@ -2,7 +2,7 @@
#include<stdio.h>
int main() {
int main(void) {
int res;
printf("Calling into sublib now.\n");
res = subfunc();

@ -1,3 +1,3 @@
int main() {
int main(void) {
return 0;
}

@ -1,5 +1,5 @@
int func();
int main() {
int main(void) {
return func() == 42 ? 0 : 1;
}

@ -1,5 +1,5 @@
int func();
int main() {
int main(void) {
return func();
}

@ -1,6 +1,6 @@
int func1();
int func2();
int main() {
int main(void) {
return func1() - func2();
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save