{"thread":{"id":"27024","subject":"[PATCH 9/9] sparse: Fix argument number/type warnings caused by the main() macro","startedAt":"2011-04-07T18:51:13Z","lastAt":"2011-04-07T18:51:13Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":9},"messages":[{"id":"165372","messageId":"4D9E07A1.4000707@ramsay1.demon.co.uk","threadId":"27024","inReplyTo":null,"subject":"[PATCH 9/9] sparse: Fix argument number/type warnings caused by the main() macro","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2011-04-07T18:51:13Z","receivedAt":"2011-04-07T18:51:13Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n\n compat/mingw.h       |    4 ++--\n fast-import.c        |    3 ++-\n git.c                |    3 ++-\n test-chmtime.c       |    2 +-\n test-index-version.c |    2 +-\n test-parse-options.c |    3 ++-\n 6 files changed, 10 insertions(+), 7 deletions(-)\n\ndiff --git a/compat/mingw.h b/compat/mingw.h\nindex 62eccd3..ddcf365 100644\n--- a/compat/mingw.h\n+++ b/compat/mingw.h\n@@ -316,8 +316,8 @@ void free_environ(char **env);\n  */\n \n #define main(c,v) dummy_decl_mingw_main(); \\\n-static int mingw_main(); \\\n-int main(int argc, const char **argv) \\\n+static int mingw_main(c,v); \\\n+int main(int argc, char **argv) \\\n { \\\n \textern CRITICAL_SECTION pinfo_cs; \\\n \t_fmode = _O_BINARY; \\\ndiff --git a/fast-import.c b/fast-import.c\nindex 65d65bf..7ba98c5 100644\n--- a/fast-import.c\n+++ b/fast-import.c\n@@ -3247,8 +3247,9 @@ static void parse_argv(void)\n \t\tread_marks();\n }\n \n-int main(int argc, const char **argv)\n+int main(int argc, char **av)\n {\n+\tconst char **argv = (const char **) av;\n \tunsigned int i;\n \n \tgit_extract_argv0_path(argv[0]);\ndiff --git a/git.c b/git.c\nindex ef598c3..31fc678 100644\n--- a/git.c\n+++ b/git.c\n@@ -507,8 +507,9 @@ static int run_argv(int *argcp, const char ***argv)\n }\n \n \n-int main(int argc, const char **argv)\n+int main(int argc, char **av)\n {\n+\tconst char **argv = (const char **) av;\n \tconst char *cmd;\n \n \tstartup_info = &git_startup_info;\ndiff --git a/test-chmtime.c b/test-chmtime.c\nindex 92713d1..8532743 100644\n--- a/test-chmtime.c\n+++ b/test-chmtime.c\n@@ -56,7 +56,7 @@ static int timespec_arg(const char *arg, long int *set_time, int *set_eq)\n \treturn 1;\n }\n \n-int main(int argc, const char *argv[])\n+int main(int argc, char *argv[])\n {\n \tstatic int verbose;\n \ndiff --git a/test-index-version.c b/test-index-version.c\nindex bfaad9e..05d4699 100644\n--- a/test-index-version.c\n+++ b/test-index-version.c\n@@ -1,6 +1,6 @@\n #include \"cache.h\"\n \n-int main(int argc, const char **argv)\n+int main(int argc, char **argv)\n {\n \tstruct cache_header hdr;\n \tint version;\ndiff --git a/test-parse-options.c b/test-parse-options.c\nindex 4e3710b..925704c 100644\n--- a/test-parse-options.c\n+++ b/test-parse-options.c\n@@ -27,8 +27,9 @@ static int number_callback(const struct option *opt, const char *arg, int unset)\n \treturn 0;\n }\n \n-int main(int argc, const char **argv)\n+int main(int argc, char **av)\n {\n+\tconst char **argv = (const char **) av;\n \tconst char *prefix = \"prefix/\";\n \tconst char *usage[] = {\n \t\t\"test-parse-options <options>\",\n-- \n1.7.4\n"}]}