{"thread":{"id":"37927","subject":"[PATCH] run-command: use void to declare that functions take no parameters","startedAt":"2014-11-10T21:17:00Z","lastAt":"2014-11-11T17:32:40Z","messageCount":4,"participants":["René Scharfe","Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"251693","messageId":"54612B4C.8010609@web.de","threadId":"37927","inReplyTo":null,"subject":"[PATCH] run-command: use void to declare that functions take no parameters","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-11-10T21:17:00Z","receivedAt":"2014-11-10T21:17:00Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Explicitly declare that git_atexit_dispatch() and git_atexit_clear()\ntake no parameters instead of leaving their parameter list empty and\nthus unspecified.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n run-command.c | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/run-command.c b/run-command.c\nindex 79a0a76..a476999 100644\n--- a/run-command.c\n+++ b/run-command.c\n@@ -636,7 +636,7 @@ static struct {\n \n static int git_atexit_installed;\n \n-static void git_atexit_dispatch()\n+static void git_atexit_dispatch(void)\n {\n \tsize_t i;\n \n@@ -644,7 +644,7 @@ static void git_atexit_dispatch()\n \t\tgit_atexit_hdlrs.handlers[i-1]();\n }\n \n-static void git_atexit_clear()\n+static void git_atexit_clear(void)\n {\n \tfree(git_atexit_hdlrs.handlers);\n \tmemset(&git_atexit_hdlrs, 0, sizeof(git_atexit_hdlrs));\n-- \n2.1.3\n"},{"id":"251695","messageId":"xmqq7fz28yo1.fsf@gitster.dls.corp.google.com","threadId":"37927","inReplyTo":"54612B4C.8010609@web.de","subject":"Re: [PATCH] run-command: use void to declare that functions take no parameters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-10T22:43:10Z","receivedAt":"2014-11-10T22:43:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"René Scharfe <l.s.r@web.de> writes:\n\n> Explicitly declare that git_atexit_dispatch() and git_atexit_clear()\n> take no parameters instead of leaving their parameter list empty and\n> thus unspecified.\n>\n> Signed-off-by: Rene Scharfe <l.s.r@web.de>\n> ---\n\nThanks.\n\nI was kind of surprised after running a git blame to find that this\nis a recent thing, and the same patch looked quite substandard with\nnumerious style violations, and I somehow managed to let them slip\nin X-<.  Perhaps I was having a bad day or something...\n\n>  run-command.c | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/run-command.c b/run-command.c\n> index 79a0a76..a476999 100644\n> --- a/run-command.c\n> +++ b/run-command.c\n> @@ -636,7 +636,7 @@ static struct {\n>  \n>  static int git_atexit_installed;\n>  \n> -static void git_atexit_dispatch()\n> +static void git_atexit_dispatch(void)\n>  {\n>  \tsize_t i;\n>  \n> @@ -644,7 +644,7 @@ static void git_atexit_dispatch()\n>  \t\tgit_atexit_hdlrs.handlers[i-1]();\n>  }\n>  \n> -static void git_atexit_clear()\n> +static void git_atexit_clear(void)\n>  {\n>  \tfree(git_atexit_hdlrs.handlers);\n>  \tmemset(&git_atexit_hdlrs, 0, sizeof(git_atexit_hdlrs));\n"},{"id":"251709","messageId":"20141111025415.GB21328@peff.net","threadId":"37927","inReplyTo":"xmqq7fz28yo1.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] run-command: use void to declare that functions take no parameters","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-11-11T02:54:15Z","receivedAt":"2014-11-11T02:54:15Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Nov 10, 2014 at 02:43:10PM -0800, Junio C Hamano wrote:\n\n> > Explicitly declare that git_atexit_dispatch() and git_atexit_clear()\n> > take no parameters instead of leaving their parameter list empty and\n> > thus unspecified.\n> [...]\n> \n> I was kind of surprised after running a git blame to find that this\n> is a recent thing, and the same patch looked quite substandard with\n> numerious style violations, and I somehow managed to let them slip\n> in X-<.  Perhaps I was having a bad day or something...\n\nI had always just assumed that -Wstrict-prototypes was part of -Wall,\nbut it is not (nor even part of -Wextra!). Maybe it is time to add it to\nyour integration-build flags. :)\n\nLooks like we also need this on top of hv/submodule-config (still in pu,\nso squashing is probably best):\n\ndiff --git a/submodule-config.h b/submodule-config.h\nindex 58afc83..9061e4e 100644\n--- a/submodule-config.h\n+++ b/submodule-config.h\n@@ -24,6 +24,6 @@ const struct submodule *submodule_from_name(const unsigned char *commit_sha1,\n \t\tconst char *name);\n const struct submodule *submodule_from_path(const unsigned char *commit_sha1,\n \t\tconst char *path);\n-void submodule_free();\n+void submodule_free(void);\n \n #endif /* SUBMODULE_CONFIG_H */\n\n-Peff\n"},{"id":"251721","messageId":"xmqqegt97idj.fsf@gitster.dls.corp.google.com","threadId":"37927","inReplyTo":"20141111025415.GB21328@peff.net","subject":"Re: [PATCH] run-command: use void to declare that functions take no parameters","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-11-11T17:32:40Z","receivedAt":"2014-11-11T17:32:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I had always just assumed that -Wstrict-prototypes was part of -Wall,\n> but it is not (nor even part of -Wextra!). Maybe it is time to add it to\n> your integration-build flags. :)\n\nYup, I had -Wold-style-definition but not -Wstrict-prototypes in the\nmix.  Thanks for spotting.\n\n>\n> Looks like we also need this on top of hv/submodule-config (still in pu,\n> so squashing is probably best):\n>\n> diff --git a/submodule-config.h b/submodule-config.h\n> index 58afc83..9061e4e 100644\n> --- a/submodule-config.h\n> +++ b/submodule-config.h\n> @@ -24,6 +24,6 @@ const struct submodule *submodule_from_name(const unsigned char *commit_sha1,\n>  \t\tconst char *name);\n>  const struct submodule *submodule_from_path(const unsigned char *commit_sha1,\n>  \t\tconst char *path);\n> -void submodule_free();\n> +void submodule_free(void);\n>  \n>  #endif /* SUBMODULE_CONFIG_H */\n>\n> -Peff\n"}]}