diff options
author | Michael Hirsch, Ph.D <scivision@users.noreply.github.com> | 2019-12-01 00:19:44 -0500 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-12-04 10:59:40 +0200 |
commit | acee448fb9b49817cadf6de9c0e09f279515bf9d (patch) | |
tree | 0e6c32e4d6ef53e7e478cf54f1d18292023798b9 | |
parent | 7d162487e37e5bf51c94bdbd753a2f928287e655 (diff) | |
download | meson-acee448fb9b49817cadf6de9c0e09f279515bf9d.zip meson-acee448fb9b49817cadf6de9c0e09f279515bf9d.tar.gz meson-acee448fb9b49817cadf6de9c0e09f279515bf9d.tar.bz2 |
ci/test: unused args for Windows
33 files changed, 86 insertions, 28 deletions
diff --git a/.github/workflows/unusedargs_missingreturn.yml b/.github/workflows/unusedargs_missingreturn.yml index a75a6d5..6c373b9 100644 --- a/.github/workflows/unusedargs_missingreturn.yml +++ b/.github/workflows/unusedargs_missingreturn.yml @@ -12,14 +12,17 @@ on: - "test cases/cmake/**" - "test cases/common/**" - "test cases/fortran/**" - - "test cases/platform-linux/**" + - "test cases/linuxlike/**" + - "test caes/windows/**" + pull_request: paths: - ".github/workflows/unusedargs_missingreturn.yml" - "test cases/cmake/**" - "test cases/common/**" - "test cases/fortran/**" - - "test cases/platform-linux/**" + - "test cases/linuxlike/**" + - "test caes/windows/**" jobs: @@ -39,3 +42,20 @@ jobs: CFLAGS: "-Werror=unused-parameter -Werror=return-type -Werror=strict-prototypes" CPPFLAGS: "-Werror=unused-parameter -Werror=return-type" FFLAGS: "-fimplicit-none" + + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: '3.x' + - run: pip install ninja + - run: python run_project_tests.py --only platform-windows + env: + CFLAGS: "-Werror=unused-parameter -Werror=return-type -Werror=strict-prototypes" + CPPFLAGS: "-Werror=unused-parameter -Werror=return-type" + FFLAGS: "-fimplicit-none" + CC: gcc + CXX: g++ + FC: gfortran diff --git a/test cases/osx/1 basic/main.c b/test cases/osx/1 basic/main.c index 2417ad8..0a07218 100644 --- a/test cases/osx/1 basic/main.c +++ b/test cases/osx/1 basic/main.c @@ -1,5 +1,5 @@ #include <CoreFoundation/CoreFoundation.h> -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/osx/2 library versions/exe.orig.c b/test cases/osx/2 library versions/exe.orig.c index 86c4adc..ad38e6d 100644 --- a/test cases/osx/2 library versions/exe.orig.c +++ b/test cases/osx/2 library versions/exe.orig.c @@ -1,8 +1,6 @@ int myFunc (void); -int -main (int argc, char *argv[]) -{ +int main (void) { if (myFunc() == 55) return 0; return 1; diff --git a/test cases/osx/2 library versions/lib.c b/test cases/osx/2 library versions/lib.c index 67b6f4d..bd251d7 100644 --- a/test cases/osx/2 library versions/lib.c +++ b/test cases/osx/2 library versions/lib.c @@ -1,3 +1,3 @@ -int myFunc() { +int myFunc(void) { return 55; } diff --git a/test cases/osx/4 framework/prog.c b/test cases/osx/4 framework/prog.c index 11b7fad..9b6bdc2 100644 --- a/test cases/osx/4 framework/prog.c +++ b/test cases/osx/4 framework/prog.c @@ -1,3 +1,3 @@ -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/osx/4 framework/stat.c b/test cases/osx/4 framework/stat.c index fa76a65..4825cef 100644 --- a/test cases/osx/4 framework/stat.c +++ b/test cases/osx/4 framework/stat.c @@ -1 +1 @@ -int func() { return 933; } +int func(void) { return 933; } diff --git a/test cases/osx/5 extra frameworks/prog.c b/test cases/osx/5 extra frameworks/prog.c index 11b7fad..9b6bdc2 100644 --- a/test cases/osx/5 extra frameworks/prog.c +++ b/test cases/osx/5 extra frameworks/prog.c @@ -1,3 +1,3 @@ -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/osx/5 extra frameworks/stat.c b/test cases/osx/5 extra frameworks/stat.c index fa76a65..4825cef 100644 --- a/test cases/osx/5 extra frameworks/stat.c +++ b/test cases/osx/5 extra frameworks/stat.c @@ -1 +1 @@ -int func() { return 933; } +int func(void) { return 933; } diff --git a/test cases/osx/7 bitcode/libbar.mm b/test cases/osx/7 bitcode/libbar.mm index 22c4dd4..d9201c1 100644 --- a/test cases/osx/7 bitcode/libbar.mm +++ b/test cases/osx/7 bitcode/libbar.mm @@ -1,7 +1,7 @@ #import <stdio.h> #import "vis.h" -int EXPORT_PUBLIC libbar(int arg) { +int EXPORT_PUBLIC libbar(void) { return 0; } diff --git a/test cases/osx/7 bitcode/libfile.c b/test cases/osx/7 bitcode/libfile.c index cc87aa0..8edc66b 100644 --- a/test cases/osx/7 bitcode/libfile.c +++ b/test cases/osx/7 bitcode/libfile.c @@ -1,5 +1,5 @@ #include "vis.h" -int EXPORT_PUBLIC libfunc() { +int EXPORT_PUBLIC libfunc(void) { return 3; } diff --git a/test cases/osx/7 bitcode/libfoo.m b/test cases/osx/7 bitcode/libfoo.m index 7981ab4..f1c35a9 100644 --- a/test cases/osx/7 bitcode/libfoo.m +++ b/test cases/osx/7 bitcode/libfoo.m @@ -1,7 +1,7 @@ #import <stdio.h> #import "vis.h" -int EXPORT_PUBLIC libfoo(int arg) { +int EXPORT_PUBLIC libfoo(void) { return 0; } diff --git a/test cases/osx/8 pie/main.c b/test cases/osx/8 pie/main.c index 2417ad8..0a07218 100644 --- a/test cases/osx/8 pie/main.c +++ b/test cases/osx/8 pie/main.c @@ -1,5 +1,5 @@ #include <CoreFoundation/CoreFoundation.h> -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/windows/10 vs module defs generated custom target/prog.c b/test cases/windows/10 vs module defs generated custom target/prog.c index 51f7805..066ac22 100644 --- a/test cases/windows/10 vs module defs generated custom target/prog.c +++ b/test cases/windows/10 vs module defs generated custom target/prog.c @@ -1,4 +1,4 @@ -int somedllfunc(); +int somedllfunc(void); int main(void) { return somedllfunc() == 42 ? 0 : 1; diff --git a/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c b/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c index b23d8fe..f095b18 100644 --- a/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c +++ b/test cases/windows/10 vs module defs generated custom target/subdir/somedll.c @@ -1,3 +1,3 @@ -int somedllfunc() { +int somedllfunc(void) { return 42; } diff --git a/test cases/windows/11 exe implib/prog.c b/test cases/windows/11 exe implib/prog.c index 2192019..aa3bc5c 100644 --- a/test cases/windows/11 exe implib/prog.c +++ b/test cases/windows/11 exe implib/prog.c @@ -1,6 +1,6 @@ #include <windows.h> int __declspec(dllexport) -main() { +main(void) { return 0; } diff --git a/test cases/windows/12 resources with custom targets/prog.c b/test cases/windows/12 resources with custom targets/prog.c index 2bef6a2..cb6892d 100644 --- a/test cases/windows/12 resources with custom targets/prog.c +++ b/test cases/windows/12 resources with custom targets/prog.c @@ -10,5 +10,10 @@ WinMain( int nCmdShow) { HICON hIcon; hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); + // avoid unused argument error while matching template + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpszCmdLine); + ((void)nCmdShow); return hIcon ? 0 : 1; } diff --git a/test cases/windows/13 test argument extra paths/exe/main.c b/test cases/windows/13 test argument extra paths/exe/main.c index 0ac9e38..1032ae2 100644 --- a/test cases/windows/13 test argument extra paths/exe/main.c +++ b/test cases/windows/13 test argument extra paths/exe/main.c @@ -1,5 +1,5 @@ #include <foo.h> -int main(int ac, char **av) { +int main(void) { return foo_process(); } diff --git a/test cases/windows/14 resources with custom target depend_files/prog.c b/test cases/windows/14 resources with custom target depend_files/prog.c index 2bef6a2..cb6892d 100644 --- a/test cases/windows/14 resources with custom target depend_files/prog.c +++ b/test cases/windows/14 resources with custom target depend_files/prog.c @@ -10,5 +10,10 @@ WinMain( int nCmdShow) { HICON hIcon; hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); + // avoid unused argument error while matching template + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpszCmdLine); + ((void)nCmdShow); return hIcon ? 0 : 1; } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c index 673b5e4..2bd8cd2 100644 --- a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c +++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_dll/main.c @@ -2,5 +2,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + // avoid unused argument error while matching template + ((void)hinstDLL); + ((void)fdwReason); + ((void)lpvReserved); return TRUE; } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c index 11b7fad..9b6bdc2 100644 --- a/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c +++ b/test cases/windows/15 resource scripts with duplicate filenames/exe3/src_exe/main.c @@ -1,3 +1,3 @@ -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c index 673b5e4..2bd8cd2 100644 --- a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c +++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_dll/main.c @@ -2,5 +2,9 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) { + // avoid unused argument error while matching template + ((void)hinstDLL); + ((void)fdwReason); + ((void)lpvReserved); return TRUE; } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c index 11b7fad..9b6bdc2 100644 --- a/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c +++ b/test cases/windows/15 resource scripts with duplicate filenames/exe4/src_exe/main.c @@ -1,3 +1,3 @@ -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/windows/15 resource scripts with duplicate filenames/verify.c b/test cases/windows/15 resource scripts with duplicate filenames/verify.c index 4d2ccf0..8f5b88e 100644 --- a/test cases/windows/15 resource scripts with duplicate filenames/verify.c +++ b/test cases/windows/15 resource scripts with duplicate filenames/verify.c @@ -1,7 +1,7 @@ #include <assert.h> #include <windows.h> -int main(int arc, char *argv[]) +int main(int argc, char *argv[]) { // verify that the expected resource exists and has the expected contents HRSRC hRsrc; @@ -9,6 +9,8 @@ int main(int arc, char *argv[]) HGLOBAL hGlobal; void* data; + ((void)argc); + hRsrc = FindResource(NULL, argv[1], RT_RCDATA); assert(hRsrc); diff --git a/test cases/windows/16 gui app/gui_prog.c b/test cases/windows/16 gui app/gui_prog.c index 4bc688a..9cdf170 100644 --- a/test cases/windows/16 gui app/gui_prog.c +++ b/test cases/windows/16 gui app/gui_prog.c @@ -2,5 +2,10 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { + // avoid unused argument error while matching template + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpCmdLine); + ((void)nCmdShow); return 0; } diff --git a/test cases/windows/2 winmain/prog.c b/test cases/windows/2 winmain/prog.c index 77d6982..3bd4c95 100644 --- a/test cases/windows/2 winmain/prog.c +++ b/test cases/windows/2 winmain/prog.c @@ -6,5 +6,10 @@ WinMain( HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { +// avoid unused argument error while matching template + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpszCmdLine); + ((void)nCmdShow); return 0; } diff --git a/test cases/windows/3 cpp/prog.cpp b/test cases/windows/3 cpp/prog.cpp index cf67335..69092f7 100644 --- a/test cases/windows/3 cpp/prog.cpp +++ b/test cases/windows/3 cpp/prog.cpp @@ -2,6 +2,6 @@ class Foo; -int main(int argc, char **argv) { +int main(void) { return 0; } diff --git a/test cases/windows/4 winmaincpp/prog.cpp b/test cases/windows/4 winmaincpp/prog.cpp index aeecb7b..6182257 100644 --- a/test cases/windows/4 winmaincpp/prog.cpp +++ b/test cases/windows/4 winmaincpp/prog.cpp @@ -8,5 +8,10 @@ WinMain( HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow) { +// avoid unused argument error while matching template + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpszCmdLine); + ((void)nCmdShow); return 0; } diff --git a/test cases/windows/5 resources/prog.c b/test cases/windows/5 resources/prog.c index afbb6ae..3409c39 100644 --- a/test cases/windows/5 resources/prog.c +++ b/test cases/windows/5 resources/prog.c @@ -12,5 +12,10 @@ WinMain( int nCmdShow) { HICON hIcon; hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(MY_ICON)); +// avoid unused argument error while matching template + ((void)hInstance); + ((void)hPrevInstance); + ((void)lpszCmdLine); + ((void)nCmdShow); return hIcon ? 0 : 1; } diff --git a/test cases/windows/6 vs module defs/prog.c b/test cases/windows/6 vs module defs/prog.c index 51f7805..066ac22 100644 --- a/test cases/windows/6 vs module defs/prog.c +++ b/test cases/windows/6 vs module defs/prog.c @@ -1,4 +1,4 @@ -int somedllfunc(); +int somedllfunc(void); int main(void) { return somedllfunc() == 42 ? 0 : 1; diff --git a/test cases/windows/6 vs module defs/subdir/somedll.c b/test cases/windows/6 vs module defs/subdir/somedll.c index b23d8fe..f095b18 100644 --- a/test cases/windows/6 vs module defs/subdir/somedll.c +++ b/test cases/windows/6 vs module defs/subdir/somedll.c @@ -1,3 +1,3 @@ -int somedllfunc() { +int somedllfunc(void) { return 42; } diff --git a/test cases/windows/7 dll versioning/lib.c b/test cases/windows/7 dll versioning/lib.c index cf7dfdd..37e0d1d 100644 --- a/test cases/windows/7 dll versioning/lib.c +++ b/test cases/windows/7 dll versioning/lib.c @@ -1,6 +1,6 @@ #ifdef _WIN32 __declspec(dllexport) #endif -int myFunc() { +int myFunc(void) { return 55; } diff --git a/test cases/windows/9 vs module defs generated/prog.c b/test cases/windows/9 vs module defs generated/prog.c index 51f7805..066ac22 100644 --- a/test cases/windows/9 vs module defs generated/prog.c +++ b/test cases/windows/9 vs module defs generated/prog.c @@ -1,4 +1,4 @@ -int somedllfunc(); +int somedllfunc(void); int main(void) { return somedllfunc() == 42 ? 0 : 1; diff --git a/test cases/windows/9 vs module defs generated/subdir/somedll.c b/test cases/windows/9 vs module defs generated/subdir/somedll.c index b23d8fe..f095b18 100644 --- a/test cases/windows/9 vs module defs generated/subdir/somedll.c +++ b/test cases/windows/9 vs module defs generated/subdir/somedll.c @@ -1,3 +1,3 @@ -int somedllfunc() { +int somedllfunc(void) { return 42; } |