use '-Werror=unused-parameter' for gcc/clang on project tests and -fimplicit-none on fortran

Fortran: check for undeclared variables by forcing implicit none everywhere
C/C++: check for unused parameters and return types

removed unused variables from test cases

ci: do missing return and unused arg check with Github Actions
pull/6195/head
Michael Hirsch, Ph.D 5 years ago committed by Jussi Pakkanen
parent c6f93b6bf6
commit 1baa1c9222
  1. 38
      .github/workflows/unusedargs_missingreturn.yml
  2. 9
      run_project_tests.py
  3. 2
      test cases/common/1 trivial/trivial.c
  4. 2
      test cases/common/100 stringdef/stringdef.c
  5. 2
      test cases/common/103 postconf/prog.c
  6. 2
      test cases/common/104 postconf with args/prog.c
  7. 2
      test cases/common/106 extract same name/main.c
  8. 2
      test cases/common/109 generatorcustom/main.c
  9. 2
      test cases/common/11 subdir/subdir/prog.c
  10. 2
      test cases/common/111 spaces backslash/comparer-end-notstring.c
  11. 2
      test cases/common/111 spaces backslash/comparer-end.c
  12. 2
      test cases/common/111 spaces backslash/comparer.c
  13. 2
      test cases/common/114 allgenerate/foobar.cpp.in
  14. 2
      test cases/common/119 subproject project arguments/exe.c
  15. 2
      test cases/common/119 subproject project arguments/exe.cpp
  16. 2
      test cases/common/119 subproject project arguments/subprojects/subexe/subexe.c
  17. 2
      test cases/common/120 test skip/test_skip.c
  18. 5
      test cases/common/121 shared module/prog.c
  19. 3
      test cases/common/122 llvm ir and assembly/main.c
  20. 3
      test cases/common/122 llvm ir and assembly/main.cpp
  21. 2
      test cases/common/123 cpp and asm/trivial.cc
  22. 2
      test cases/common/124 extract all shared library/prog.c
  23. 2
      test cases/common/125 object only target/prog.c
  24. 2
      test cases/common/126 no buildincdir/prog.c
  25. 2
      test cases/common/128 dependency file generation/main .c
  26. 2
      test cases/common/129 configure file in generator/src/main.c
  27. 2
      test cases/common/13 pch/c/prog.c
  28. 2
      test cases/common/13 pch/cpp/prog.cc
  29. 2
      test cases/common/13 pch/generated/prog.c
  30. 2
      test cases/common/13 pch/mixed/main.cc
  31. 2
      test cases/common/13 pch/userDefined/prog.c
  32. 2
      test cases/common/13 pch/withIncludeDirectories/prog.c
  33. 3
      test cases/common/130 generated llvm ir/main.c
  34. 3
      test cases/common/131 generated assembly/main.c
  35. 2
      test cases/common/132 build by default targets in tests/main.c
  36. 2
      test cases/common/133 build by default/foo.c
  37. 3
      test cases/common/134 include order/ordertest.c
  38. 2
      test cases/common/134 include order/sub4/main.c
  39. 2
      test cases/common/135 override options/four.c
  40. 2
      test cases/common/135 override options/two.c
  41. 2
      test cases/common/137 c cpp and asm/main.c
  42. 2
      test cases/common/137 c cpp and asm/main.cpp
  43. 2
      test cases/common/138 compute int/prog.c.in
  44. 2
      test cases/common/139 custom target object output/progdir/prog.c
  45. 2
      test cases/common/14 configure file/dumpprog.c
  46. 2
      test cases/common/14 configure file/prog.c
  47. 2
      test cases/common/14 configure file/prog2.c
  48. 2
      test cases/common/14 configure file/prog4.c
  49. 2
      test cases/common/14 configure file/prog5.c
  50. 2
      test cases/common/14 configure file/prog6.c
  51. 2
      test cases/common/14 configure file/prog7.c
  52. 2
      test cases/common/14 configure file/prog9.c
  53. 2
      test cases/common/141 whole archive/prog.c
  54. 2
      test cases/common/149 recursive linking/3rdorderdeps/main.c.in
  55. 2
      test cases/common/149 recursive linking/circular/main.c
  56. 2
      test cases/common/149 recursive linking/edge-cases/shstmain.c
  57. 2
      test cases/common/149 recursive linking/edge-cases/stomain.c
  58. 2
      test cases/common/149 recursive linking/main.c
  59. 2
      test cases/common/15 if/prog.c
  60. 2
      test cases/common/151 simd/simdchecker.c
  61. 5
      test cases/common/152 shared module resolving symbol in executable/prog.c
  62. 2
      test cases/common/153 dotinclude/dotproc.c
  63. 2
      test cases/common/154 reserved targets/test.c
  64. 2
      test cases/common/157 wrap file should not failed/src/subprojects/foo/prog2.c
  65. 2
      test cases/common/157 wrap file should not failed/src/subprojects/prog.c
  66. 2
      test cases/common/158 includedir subproj/prog.c
  67. 2
      test cases/common/159 subproject dir name collision/a.c
  68. 2
      test cases/common/16 else/prog.c
  69. 2
      test cases/common/17 comparison/prog.c
  70. 2
      test cases/common/170 get project license/bar.c
  71. 2
      test cases/common/172 subproject nested subproject dirs/prog.c
  72. 2
      test cases/common/173 preserve gendir/testprog.c
  73. 2
      test cases/common/174 source in dep/generated/main.c
  74. 2
      test cases/common/18 array/prog.c
  75. 2
      test cases/common/183 bothlibraries/main.c
  76. 2
      test cases/common/187 find override/otherdir/main.c
  77. 2
      test cases/common/187 find override/otherdir/main2.c
  78. 2
      test cases/common/19 includedir/src/prog.c
  79. 2
      test cases/common/195 install_mode/trivial.c
  80. 2
      test cases/common/2 cpp/trivial.cc
  81. 2
      test cases/common/20 header in file list/prog.c
  82. 2
      test cases/common/200 generator in subdir/com/mesonbuild/testprog.c
  83. 1
      test cases/common/201 override with exe/subprojects/sub/foobar.c
  84. 2
      test cases/common/202 subproject with features/nothing.c
  85. 2
      test cases/common/207 kwarg entry/prog.c
  86. 2
      test cases/common/21 global arg/prog.c
  87. 2
      test cases/common/21 global arg/prog.cc
  88. 2
      test cases/common/215 link custom/prog.c
  89. 2
      test cases/common/216 link custom_i single from multiple/prog.c
  90. 2
      test cases/common/217 link custom_i multiple from multiple/prog.c
  91. 2
      test cases/common/22 target arg/prog.cc
  92. 2
      test cases/common/22 target arg/prog2.cc
  93. 2
      test cases/common/23 object extraction/main.c
  94. 2
      test cases/common/24 endian/prog.c
  95. 2
      test cases/common/26 config subdir/src/prog.c
  96. 1
      test cases/common/27 pipeline/depends/filecopier.c
  97. 2
      test cases/common/27 pipeline/depends/prog.c
  98. 2
      test cases/common/27 pipeline/prog.c
  99. 2
      test cases/common/27 pipeline/src/prog.c
  100. 2
      test cases/common/28 find program/source.in
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,38 @@
name: UnusedMissingReturn
# this workflow checks for usused input arguments or missing return values in test cases.
# some users have default configs that will needlessly fail Meson self-tests due to these syntax.
on:
push:
paths:
- "**.yml"
- "test cases/cmake/**"
- "test cases/common/**"
- "test cases/fortran/**"
- "test cases/platform-linux/**"
pull_request:
paths:
- "**.yml"
- "test cases/cmake/**"
- "test cases/common/**"
- "test cases/fortran/**"
- "test cases/platform-linux/**"
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install Compilers
run: |
sudo apt update -yq
sudo apt install -yq --no-install-recommends g++ gfortran ninja-build
- run: python run_project_tests.py --only cmake common fortran platform-linux
env:
CFLAGS: "-Werror=unused-parameter -Werror=return-type"
CPPFLAGS: "-Werror=unused-parameter -Werror=return-type"
FFLAGS: "-fimplicit-none"

@ -651,14 +651,18 @@ def detect_tests_to_run(only: typing.List[str]) -> typing.List[typing.Tuple[str,
gathered_tests = [(name, gather_tests(Path('test cases', subdir)), skip) for name, subdir, skip in all_tests]
return gathered_tests
def run_tests(all_tests, log_name_base, failfast: bool, extra_args):
def run_tests(all_tests: typing.List[typing.Tuple[str, typing.List[Path], bool]],
log_name_base: str, failfast: bool,
extra_args: typing.List[str]) -> typing.Tuple[int, int, int]:
global logfile
txtname = log_name_base + '.txt'
with open(txtname, 'w', encoding='utf-8', errors='ignore') as lf:
logfile = lf
return _run_tests(all_tests, log_name_base, failfast, extra_args)
def _run_tests(all_tests, log_name_base, failfast: bool, extra_args):
def _run_tests(all_tests: typing.List[typing.Tuple[str, typing.List[Path], bool]],
log_name_base: str, failfast: bool,
extra_args: typing.List[str]) -> typing.Tuple[int, int, int]:
global stop, executor, futures, system_compiler
xmlname = log_name_base + '.xml'
junit_root = ET.Element('testsuites')
@ -707,6 +711,7 @@ def _run_tests(all_tests, log_name_base, failfast: bool, extra_args):
if name.startswith('warning'):
suite_args = ['--fatal-meson-warnings']
should_fail = name.split('warning-')[1]
result = executor.submit(run_test, skipped, t.as_posix(), extra_args + suite_args,
system_compiler, backend, backend_flags, commands, should_fail)
futures.append((testname, t, result))

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

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

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

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

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

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

@ -1 +1 @@
int main(int argc, char **argv) { return 0; }
int main() { return 0; }

@ -10,7 +10,7 @@
#define COMPARE_WITH "foo\\bar\\" /* This is the literal `foo\bar\` */
int main(int argc, char **argv) {
int main() {
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 argc, char **argv) {
int main () {
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 argc, char **argv) {
int main () {
if (strcmp (DEF_WITH_BACKSLASH, COMPARE_WITH)) {
printf ("Arg string is quoted incorrectly: %s instead of %s\n",
DEF_WITH_BACKSLASH, COMPARE_WITH);

@ -1,6 +1,6 @@
#include<stdio.h>
int main(int argc, char **argv) {
int main() {
printf("I am a program.\n");
return 0;
}

@ -22,6 +22,6 @@
#error
#endif
int main(int argc, char **argv) {
int main() {
return 0;
}

@ -22,7 +22,7 @@
#error
#endif
int main(int argc, char **argv) {
int main() {
return 0;
}

@ -22,6 +22,6 @@
#error
#endif
int main(int argc, char **argv) {
int main() {
return 0;
}

@ -1,3 +1,3 @@
int main(int argc, char *argv[]) {
int main() {
return 77;
}

@ -21,13 +21,13 @@ win32_get_last_error (void)
return msg;
}
int
main (int argc, char **argv)
int main(int argc, char **argv)
{
HINSTANCE handle;
fptr importedfunc;
int expected, actual;
int ret = 1;
if(argc==0) {};
handle = LoadLibraryA (argv[1]);
if (!handle) {
@ -68,6 +68,7 @@ int main(int argc, char **argv) {
int expected, actual;
char *error;
int ret = 1;
if(argc==0) {};
dlerror();
dl = dlopen(argv[1], RTLD_LAZY);

@ -2,8 +2,7 @@
unsigned square_unsigned (unsigned a);
int
main (int argc, char * argv[])
int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -4,8 +4,7 @@ extern "C" {
unsigned square_unsigned (unsigned a);
}
int
main (int argc, char * argv[])
int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -4,7 +4,7 @@ extern "C" {
int get_retval(void);
}
int main(int argc, char **argv) {
int main() {
std::cout << "C++ seems to be working." << std::endl;
#if defined(USE_ASM)
return get_retval();

@ -1,7 +1,7 @@
#include"extractor.h"
#include<stdio.h>
int main(int argc, char **argv) {
int main() {
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 argc, char **argv) {
int main() {
return func1_in_obj() + func2_in_obj() + func3_in_obj();
}

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

@ -1,3 +1,3 @@
int main(int argc, char *argv[]) {
int main() {
return 0;
}

@ -12,6 +12,6 @@
#error Source RESULT is not defined correctly
#endif
int main(int argc, char **argv) {
int main() {
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 argc, char **argv) {
int main() {
return 0;
}

@ -5,7 +5,7 @@ void func() {
<< std::endl;
}
int main(int argc, char **argv) {
int main() {
func();
return 0;
}

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

@ -5,6 +5,6 @@ void func() {
<< std::endl;
}
int main(int argc, char **argv) {
int main() {
return cfunc();
}

@ -1,6 +1,6 @@
// No includes here, they need to come from the PCH
int main(int argc, char **argv) {
int main() {
// 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 argc, char **argv) {
int main() {
return 0;
}

@ -2,8 +2,7 @@
unsigned square_unsigned (unsigned a);
int
main (int argc, char * argv[])
int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -5,8 +5,7 @@
#endif
unsigned square_unsigned (unsigned a);
int
main (int argc, char * argv[])
int main ()
{
unsigned int ret = square_unsigned (2);
if (ret != 4) {

@ -1,3 +1,3 @@
int main (int argc, char *argv[]) {
int main () {
return 0;
}

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

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

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

@ -4,6 +4,6 @@ static int duplicate_func() {
return -4;
}
int main(int argc, char **argv) {
int main() {
return duplicate_func() + func();
}

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

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

@ -5,7 +5,7 @@ extern "C" {
int get_cval(void);
}
int main(int argc, char **argv) {
int main() {
std::cout << "C++ seems to be working." << std::endl;
return get_retval();
}

@ -4,7 +4,7 @@
#include <limits.h>
#include "foobar.h"
int main(int argc, char **argv) {
int main() {
if(INTSIZE != sizeof(int)) {
fprintf(stderr, "Mismatch: computed int size %d, actual size %d.\n", INTSIZE, (int)sizeof(int));
return 1;

@ -1,5 +1,5 @@
int func1_in_obj();
int main(int argc, char **argv) {
int main() {
return func1_in_obj();
}

@ -15,7 +15,7 @@
#define stringify(s) str(s)
#define str(s) #s
int main(int argc, char **argv) {
int main() {
#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 argc, char **argv) {
int main() {
#ifndef BE_TRUE
return 1;
#else

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

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

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

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

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

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

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

@ -4,7 +4,7 @@
SYMBOL_IMPORT int get_@LIBTYPE@@DEPENDENCY@dep_value (void);
int main(int argc, char *argv[]) {
int main() {
int val;
val = get_@LIBTYPE@@DEPENDENCY@dep_value ();

@ -6,7 +6,7 @@ int get_st1_value (void);
int get_st2_value (void);
int get_st3_value (void);
int main(int argc, char *argv[]) {
int main() {
int val;
val = get_st1_value ();

@ -4,7 +4,7 @@
int get_stshdep_value (void);
int main(int argc, char *argv[]) {
int main() {
int val;
val = get_stshdep_value ();

@ -4,7 +4,7 @@
int get_stodep_value (void);
int main(int argc, char *argv[]) {
int main() {
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 argc, char *argv[]) {
int main() {
int val;
val = get_shnodep_value ();

@ -1 +1 @@
int main(int argc, char **argv) { return 0; }
int main() { return 0; }

@ -23,7 +23,7 @@ int check_simd_implementation(float *four,
return rv;
}
int main(int argc, char **argv) {
int main() {
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};

@ -25,12 +25,13 @@ func_from_executable(void)
return 42;
}
int
main (int argc, char **argv)
int main(int argc, char **argv)
{
int expected, actual;
fptr importedfunc;
if (argc=0) {}; // noop
#ifdef _WIN32
HMODULE h = LoadLibraryA(argv[1]);
#else

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

@ -1,3 +1,3 @@
int main(int argc, char *argv[]) {
int main() {
return 0;
}

@ -1,6 +1,6 @@
#include<stdio.h>
int main(int argc, char **argv) {
int main() {
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 argc, char **argv) {
int main() {
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,4 @@
int main(int argc, char **argv) {
int main() {
return 0;
}

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

@ -1 +1 @@
int main(int argc, char **argv) { return 0; }
int main() { return 0; }

@ -1 +1 @@
int main(int argc, char **argv) { return 0; }
int main() { return 0; }

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

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

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

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

@ -1,3 +1,3 @@
extern int func();
int main(int argc, char **argv) { return func(); }
int main() { return func(); }

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

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

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

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

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

@ -1,6 +1,6 @@
#include<iostream>
int main(int argc, char **argv) {
int main() {
std::cout << "C++ seems to be working." << std::endl;
return 0;
}

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

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

@ -2,6 +2,7 @@
#include <stdio.h>
int main(int argc, char* argv[]) {
assert(argc == 2);
FILE *f = fopen(argv[1], "w");
const char msg[] = "int main(void) {return 0;}\n";
size_t w = fwrite(msg, 1, sizeof(msg) - 1, f);

@ -1,4 +1,4 @@
int main(int argc, char const *argv[])
int main()
{
return 0;
}

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

@ -38,6 +38,6 @@
#endif
#endif
int main(int argc, char **argv) {
int main() {
return 0;
}

@ -10,6 +10,6 @@
#error "Global argument not set"
#endif
int main(int argc, char **argv) {
int main() {
return 0;
}

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

@ -1,5 +1,5 @@
int flob();
int main(int argc, char **argv) {
int main() {
return (flob() == 1 ? 0 : 1);
}

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

@ -8,6 +8,6 @@
extern "C" int func();
int main(int argc, char **argv) {
int main() {
return func();
}

@ -8,6 +8,6 @@
extern "C" int func();
int main(int argc, char **argv) {
int main() {
return func();
}

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

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

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

@ -9,6 +9,7 @@ int main(int argc, char **argv) {
size_t num_written;
FILE *fin = fopen(argv[1], "rb");
FILE *fout;
assert(argc>0);
assert(fin);
num_read = fread(buffer, 1, BUFSIZE, fin);
assert(num_read > 0);

@ -1,5 +1,5 @@
int func();
int main(int argc, char **argv) {
int main() {
return func() != 42;
}

@ -1,5 +1,5 @@
int func();
int main(int argc, char **argv) {
int main() {
return func();
}

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

@ -1,3 +1,3 @@
int main(int argc, char **argv) {
int main() {
return 0;
}

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

Loading…
Cancel
Save