diff options
author | Jonathon Reinhart <Jonathon.Reinhart@gmail.com> | 2018-02-10 04:49:36 (GMT) |
---|---|---|
committer | Jonathon Reinhart <Jonathon.Reinhart@gmail.com> | 2018-02-11 23:13:26 (GMT) |
commit | 090107e5282cdbff7481a52467b9abcba5a9652d (patch) | |
tree | fa27dd177c482671e9c9487c7e0bb9c961967310 | |
parent | 8c41b52ca3d502bfd0444bf2640e345fb7b2ae9d (diff) | |
download | SCons-090107e5282cdbff7481a52467b9abcba5a9652d.zip SCons-090107e5282cdbff7481a52467b9abcba5a9652d.tar.gz SCons-090107e5282cdbff7481a52467b9abcba5a9652d.tar.bz2 |
Replace all instances of `int main()` with `int main(void)`
34 files changed, 60 insertions, 60 deletions
diff --git a/bin/SConsExamples.py b/bin/SConsExamples.py index 722e50a..a2ed570 100644 --- a/bin/SConsExamples.py +++ b/bin/SConsExamples.py @@ -39,7 +39,7 @@ # env.Program('foo') # </file> # <file name="foo.c"> -# int main() { printf("foo.c\n"); } +# int main(void) { printf("foo.c\n"); } # </file> # </scons_example> # diff --git a/src/engine/SCons/Conftest.py b/src/engine/SCons/Conftest.py index abaf00d..84aa992 100644 --- a/src/engine/SCons/Conftest.py +++ b/src/engine/SCons/Conftest.py @@ -136,7 +136,7 @@ def CheckBuilder(context, text = None, language = None): if not text: text = """ -int main() { +int main(void) { return 0; } """ @@ -157,7 +157,7 @@ def CheckCC(context): """ context.Display("Checking whether the C compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -177,7 +177,7 @@ def CheckSHCC(context): """ context.Display("Checking whether the (shared) C compiler works... ") text = """ -int foo() +int foo(void) { return 0; } @@ -197,7 +197,7 @@ def CheckCXX(context): """ context.Display("Checking whether the C++ compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -217,7 +217,7 @@ def CheckSHCXX(context): """ context.Display("Checking whether the (shared) C++ compiler works... ") text = """ -int main() +int main(void) { return 0; } @@ -290,7 +290,7 @@ char %s();""" % function_name #include <assert.h> %(hdr)s -int main() { +int main(void) { #if defined (__stub_%(name)s) || defined (__stub___%(name)s) fail fail fail #else @@ -400,7 +400,7 @@ def CheckType(context, type_name, fallback = None, %(include)s %(header)s -int main() { +int main(void) { if ((%(name)s *) 0) return 0; if (sizeof (%(name)s)) @@ -465,7 +465,7 @@ def CheckTypeSize(context, type_name, header = None, language = None, expect = N src = src + r""" typedef %s scons_check_type; -int main() +int main(void) { static int test_array[1 - 2 * !(((long int) (sizeof(scons_check_type))) == %d)]; test_array[0] = 0; @@ -498,7 +498,7 @@ int main() src = src + """ #include <stdlib.h> #include <stdio.h> -int main() { +int main(void) { printf("%d", (int)sizeof(""" + type_name + """)); return 0; } @@ -560,7 +560,7 @@ def CheckDeclaration(context, symbol, includes = None, language = None): context.Display('Checking whether %s is declared... ' % symbol) src = src + r""" -int main() +int main(void) { #ifndef %s (void) %s; diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py index f4c6f89..65c4b5f 100644 --- a/src/engine/SCons/SConfTests.py +++ b/src/engine/SCons/SConfTests.py @@ -115,9 +115,9 @@ class SConfTestCase(unittest.TestCase): def checks(self, sconf, TryFuncString): TryFunc = self.SConf.SConfBase.__dict__[TryFuncString] - res1 = TryFunc( sconf, "int main() { return 0; }\n", ".c" ) + res1 = TryFunc( sconf, "int main(void) { return 0; }\n", ".c" ) res2 = TryFunc( sconf, - '#include "no_std_header.h"\nint main() {return 0; }\n', + '#include "no_std_header.h"\nint main(void) {return 0; }\n', '.c' ) return (res1,res2) @@ -254,7 +254,7 @@ class SConfTestCase(unittest.TestCase): def checks(sconf): prog = """ #include <stdio.h> -int main() { +int main(void) { printf( "Hello" ); return 0; } @@ -755,7 +755,7 @@ int main() { prog = """ #include <stdio.h> -int main() { +int main(void) { printf( "Hello" ); return 0; } diff --git a/src/engine/SCons/Scanner/CTests.py b/src/engine/SCons/Scanner/CTests.py index 9c7df12..c31d373 100644 --- a/src/engine/SCons/Scanner/CTests.py +++ b/src/engine/SCons/Scanner/CTests.py @@ -48,7 +48,7 @@ test.write('f1.cpp',""" #include \"f1.h\" #include <f2.h> -int main() +int main(void) { return 0; } @@ -60,7 +60,7 @@ test.write('f2.cpp',""" #include \"f1.h\" #import <f4.h> -int main() +int main(void) { return 0; } @@ -79,7 +79,7 @@ test.write('f3.cpp',""" const char* x = "#include <never.h>" -int main() +int main(void) { return 0; } @@ -113,7 +113,7 @@ test.write('fa.cpp',""" #include \"fa.h\" #include <fb.h> -int main() +int main(void) { return 0; } @@ -135,7 +135,7 @@ test.write(['work', 'src', 'fff.c'], """ #include <iii.h> #include <jjj.h> -int main() +int main(void) { return 0; } @@ -144,7 +144,7 @@ int main() test.write([ 'work', 'src', 'aaa.c'], """ #include "bbb.h" -int main() +int main(void) { return 0; } @@ -155,7 +155,7 @@ test.write([ 'work', 'src', 'bbb.h'], "\n") test.write([ 'repository', 'src', 'ccc.c'], """ #include "ddd.h" -int main() +int main(void) { return 0; } diff --git a/src/engine/SCons/Scanner/IDLTests.py b/src/engine/SCons/Scanner/IDLTests.py index 227799e..7b53801 100644 --- a/src/engine/SCons/Scanner/IDLTests.py +++ b/src/engine/SCons/Scanner/IDLTests.py @@ -159,7 +159,7 @@ test.write(['work', 'src', 'fff.c'], """ #include <iii.idl> #include <jjj.idl> -int main() +int main(void) { return 0; } @@ -168,7 +168,7 @@ int main() test.write([ 'work', 'src', 'aaa.c'], """ #include "bbb.idl" -int main() +int main(void) { return 0; } @@ -179,7 +179,7 @@ test.write([ 'work', 'src', 'bbb.idl'], "\n") test.write([ 'repository', 'src', 'ccc.c'], """ #include "ddd.idl" -int main() +int main(void) { return 0; } diff --git a/test/CacheDir/up-to-date-q.py b/test/CacheDir/up-to-date-q.py index 275b127..f0e3962 100644 --- a/test/CacheDir/up-to-date-q.py +++ b/test/CacheDir/up-to-date-q.py @@ -55,7 +55,7 @@ test = TestSCons.TestSCons() test.subdir('cache', 'alpha', 'beta') foo_c = """ -int main(){ return 0; } +int main(void){ return 0; } """ sconstruct = """ diff --git a/test/Case.py b/test/Case.py index fb6821d..193da54 100644 --- a/test/Case.py +++ b/test/Case.py @@ -43,7 +43,7 @@ test.write('main.c', """\ void foo(); void bar(); -int main() { +int main(void) { foo(); bar(); exit (0); diff --git a/test/Configure/VariantDir-SConscript.py b/test/Configure/VariantDir-SConscript.py index c82778a..deb7b8f 100644 --- a/test/Configure/VariantDir-SConscript.py +++ b/test/Configure/VariantDir-SConscript.py @@ -96,7 +96,7 @@ test.write(['sub', 'TestProgram.c'], """\ #include "TestProgram.h" #include <stdio.h> -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/VariantDir.py b/test/Configure/VariantDir.py index 01df276..23a4b14 100644 --- a/test/Configure/VariantDir.py +++ b/test/Configure/VariantDir.py @@ -63,7 +63,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include <stdio.h> -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/VariantDir2.py b/test/Configure/VariantDir2.py index 62b832f..ffe6525 100644 --- a/test/Configure/VariantDir2.py +++ b/test/Configure/VariantDir2.py @@ -41,7 +41,7 @@ SConscript('SConscript', variant_dir='build', src='.') test.write('SConscript', """\ env = Environment() config = env.Configure(conf_dir='sconf', log_file='config.log') -config.TryRun("int main() {}", ".c") +config.TryRun("int main(void) {}", ".c") config.Finish() """) diff --git a/test/Configure/basic.py b/test/Configure/basic.py index 4344941..4038a45 100644 --- a/test/Configure/basic.py +++ b/test/Configure/basic.py @@ -61,7 +61,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include <stdio.h> -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/build-fail.py b/test/Configure/build-fail.py index 74609f6..218cf18 100644 --- a/test/Configure/build-fail.py +++ b/test/Configure/build-fail.py @@ -58,7 +58,7 @@ def _check(context): result = context.TryRun(''' #include "%s" - int main() { return 0; } + int main(void) { return 0; } ''' % inc, '.cpp')[0] if result: import sys diff --git a/test/Configure/clean.py b/test/Configure/clean.py index bb15165..d7a5dc7 100644 --- a/test/Configure/clean.py +++ b/test/Configure/clean.py @@ -53,7 +53,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include <stdio.h> -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/Configure/custom-tests.py b/test/Configure/custom-tests.py index 7bb2366..6362e25 100644 --- a/test/Configure/custom-tests.py +++ b/test/Configure/custom-tests.py @@ -41,12 +41,12 @@ CR = test.CR # cached rebuild (up to date) NCF = test.NCF # non-cached build failure CF = test.CF # cached build failure -compileOK = '#include <stdio.h>\\nint main() {printf("Hello");return 0;}' +compileOK = '#include <stdio.h>\\nint main(void) {printf("Hello");return 0;}' compileFAIL = "syntax error" linkOK = compileOK -linkFAIL = "void myFunc(); int main() { myFunc(); }" +linkFAIL = "void myFunc(); int main(void) { myFunc(); }" runOK = compileOK -runFAIL = "int main() { return 1; }" +runFAIL = "int main(void) { return 1; }" test.write('pyAct.py', """\ from __future__ import print_function diff --git a/test/Configure/help.py b/test/Configure/help.py index f42088b..32f74da 100644 --- a/test/Configure/help.py +++ b/test/Configure/help.py @@ -53,7 +53,7 @@ env.Program( 'TestProgram', 'TestProgram.c' ) test.write('TestProgram.c', """\ #include <stdio.h> -int main() { +int main(void) { printf( "Hello\\n" ); } """) diff --git a/test/FindSourceFiles.py b/test/FindSourceFiles.py index 88b9d7e..62b906c 100644 --- a/test/FindSourceFiles.py +++ b/test/FindSourceFiles.py @@ -63,7 +63,7 @@ foo_c = env.Substfile('foo.c.in', SUBST_DICT = {'__A__' : '0' }) foo = env.Program(foo_c) """) -test.write('src/foo.c.in', """ int main() { return __A__;} +test.write('src/foo.c.in', """ int main(void) { return __A__;} """) test.run(arguments = 'package') diff --git a/test/Interactive/added-include.py b/test/Interactive/added-include.py index 86a473d..e65cb14 100644 --- a/test/Interactive/added-include.py +++ b/test/Interactive/added-include.py @@ -41,7 +41,7 @@ test.write('foo.h.in', """ test.write('foo.c', """ #include <stdio.h> -int main() +int main(void) { printf("foo.c\\n"); return 0; @@ -81,7 +81,7 @@ test.write('foo.c', """ #include <stdio.h> -int main() +int main(void) { printf("%s\\n", FOO_STRING); return 0; diff --git a/test/Interactive/implicit-VariantDir.py b/test/Interactive/implicit-VariantDir.py index 5ef4583..fc52080 100644 --- a/test/Interactive/implicit-VariantDir.py +++ b/test/Interactive/implicit-VariantDir.py @@ -74,7 +74,7 @@ test.write(['src', 'foo.c'], """ #define FOO_PRINT_STRING "Hello from foo.c" -int main() +int main(void) { printf(FOO_PRINT_STRING "\\n"); return 0; @@ -115,7 +115,7 @@ test.write(['src', 'foo.c'], """ #include "foo.h" #include <stdio.h> -int main() +int main(void) { printf(FOO_PRINT_STRING "\\n"); return 0; diff --git a/test/LINK/VersionedLib-VariantDir.py b/test/LINK/VersionedLib-VariantDir.py index 0350c6e..340fee0 100644 --- a/test/LINK/VersionedLib-VariantDir.py +++ b/test/LINK/VersionedLib-VariantDir.py @@ -65,7 +65,7 @@ test.write(['src','bin','main.c'], """ __declspec(dllimport) #endif int foo(); -int main() +int main(void) { return foo(); } diff --git a/test/LINK/VersionedLib-j2.py b/test/LINK/VersionedLib-j2.py index 4646a37..ed3b7ff 100644 --- a/test/LINK/VersionedLib-j2.py +++ b/test/LINK/VersionedLib-j2.py @@ -57,7 +57,7 @@ test.write('main.c', """ __declspec(dllimport) #endif int foo(); -int main() { return foo(); } +int main(void) { return foo(); } """) test.write('SConstruct', """ diff --git a/test/LINK/VersionedLib-subdir.py b/test/LINK/VersionedLib-subdir.py index 91f3011..2271a54 100644 --- a/test/LINK/VersionedLib-subdir.py +++ b/test/LINK/VersionedLib-subdir.py @@ -58,7 +58,7 @@ test.write('main.c', """ __declspec(dllimport) #endif int foo(); -int main() +int main(void) { return foo(); } diff --git a/test/Libs/Library.py b/test/Libs/Library.py index b603926..50fe68b 100644 --- a/test/Libs/Library.py +++ b/test/Libs/Library.py @@ -152,7 +152,7 @@ void nrd() { test.write('uses-nrd.c', r""" void nrd(); -int main() { +int main(void) { nrd(); return 0; } diff --git a/test/MSVC/pch-basics.py b/test/MSVC/pch-basics.py index 45735ed..ebee0da 100644 --- a/test/MSVC/pch-basics.py +++ b/test/MSVC/pch-basics.py @@ -39,7 +39,7 @@ test.skip_if_not_msvc() test.write('Main.cpp', """\ #include "Precompiled.h" -int main() +int main(void) { return testf(); } diff --git a/test/MSVC/pch-spaces-subdir.py b/test/MSVC/pch-spaces-subdir.py index 3a65b44..65595fc 100644 --- a/test/MSVC/pch-spaces-subdir.py +++ b/test/MSVC/pch-spaces-subdir.py @@ -39,7 +39,7 @@ test.skip_if_not_msvc() test.write('Main.cpp', """\ #include "Precompiled.h" -int main() +int main(void) { return testf(); } diff --git a/test/MSVS/CPPPATH-Dirs.py b/test/MSVS/CPPPATH-Dirs.py index 45ec846..53c7a8b 100644 --- a/test/MSVS/CPPPATH-Dirs.py +++ b/test/MSVS/CPPPATH-Dirs.py @@ -68,7 +68,7 @@ test.write('SConstruct', SConscript_contents) test.write('main.cpp', """\
#include <stdio.h>
-int main() {
+int main(void) {
printf("hello, world!\\n");
}
""")
diff --git a/test/QT/CPPPATH-appended.py b/test/QT/CPPPATH-appended.py index 2780921..98baad8 100644 --- a/test/QT/CPPPATH-appended.py +++ b/test/QT/CPPPATH-appended.py @@ -57,7 +57,7 @@ env.Program(target = 'aaa', source = 'aaa.cpp') test.write(['sub', 'aaa.cpp'], r""" #include "aaa.h" -int main() { aaa(); return 0; } +int main(void) { aaa(); return 0; } """) test.write(['sub', 'aaa.h'], r""" diff --git a/test/QT/CPPPATH.py b/test/QT/CPPPATH.py index 4ea42bd..5de41d9 100644 --- a/test/QT/CPPPATH.py +++ b/test/QT/CPPPATH.py @@ -47,7 +47,7 @@ env.Program(target = 'aaa', source = 'aaa.cpp', CPPPATH=['$CPPPATH', './local_in test.write('aaa.cpp', r""" #include "aaa.h" -int main() { aaa(); return 0; } +int main(void) { aaa(); return 0; } """) test.write('aaa.h', r""" diff --git a/test/QT/QTFLAGS.py b/test/QT/QTFLAGS.py index 8d266ad..61a1d87 100644 --- a/test/QT/QTFLAGS.py +++ b/test/QT/QTFLAGS.py @@ -127,7 +127,7 @@ test.write(['work1', 'main.cpp'], """ #include "uic-another_ui_file.hpp" void mocFromCpp(); -int main() { +int main(void) { mocFromH(); mocFromCpp(); an_ui_file(); @@ -189,7 +189,7 @@ env2.Program('main.cpp') """ % {'QTDIR':QT}) test.write(['work2', 'main.cpp'], """ -int main() { return 0; } +int main(void) { return 0; } """) # Ignore stderr, because if Qt is not installed, diff --git a/test/QT/empty-env.py b/test/QT/empty-env.py index 77547e7..b7867e5 100644 --- a/test/QT/empty-env.py +++ b/test/QT/empty-env.py @@ -46,7 +46,7 @@ env.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) test.write('main.cpp', r""" #include "foo6.h" -int main() { foo6(); return 0; } +int main(void) { foo6(); return 0; } """) test.write(['qt', 'include', 'foo6.h'], """\ diff --git a/test/QT/manual.py b/test/QT/manual.py index 1f140ae..c5cf74e 100644 --- a/test/QT/manual.py +++ b/test/QT/manual.py @@ -119,7 +119,7 @@ test.write('main.cpp', r""" #include "eee.h" #include "uic_fff.hpp" -int main() { +int main(void) { aaa(); bbb(); ccc(); ddd(); eee(); fff(); return 0; } """) diff --git a/test/QT/moc-from-header.py b/test/QT/moc-from-header.py index 41b1b3d..4151cba 100644 --- a/test/QT/moc-from-header.py +++ b/test/QT/moc-from-header.py @@ -61,7 +61,7 @@ if env['PLATFORM'] == 'darwin': test.write('aaa.cpp', r""" #include "aaa.h" -int main() { aaa(); return 0; } +int main(void) { aaa(); return 0; } """) test.write('aaa.h', r""" diff --git a/test/QT/reentrant.py b/test/QT/reentrant.py index be464b9..af19af9 100644 --- a/test/QT/reentrant.py +++ b/test/QT/reentrant.py @@ -56,7 +56,7 @@ env.Program('main', 'main.cpp', CPPDEFINES=['FOO'], LIBS=[]) test.write('main.cpp', r""" #include "foo5.h" -int main() { foo5(); return 0; } +int main(void) { foo5(); return 0; } """) test.run() diff --git a/test/RPATH.py b/test/RPATH.py index 4e13bb1..754abfe 100644 --- a/test/RPATH.py +++ b/test/RPATH.py @@ -46,7 +46,7 @@ Program('foo', 'foo.c', LIBS='bar', LIBPATH='bar', RPATH='bar') test.write('foo.c', """\ #include <stdlib.h> -int main() { +int main(void) { void bar(); bar(); exit (0); diff --git a/test/YACC/live.py b/test/YACC/live.py index 253a387..6dd08f7 100644 --- a/test/YACC/live.py +++ b/test/YACC/live.py @@ -60,7 +60,7 @@ extern int yyparse(); int yyerror(char *s); int yylex(); -int main() +int main(void) { return yyparse(); } @@ -108,7 +108,7 @@ file_hpp = 'file.hpp' test.write("hello.cpp", """\ #include "%(file_hpp)s" -int main() +int main(void) { } """ % locals()) |