{"thread":{"id":"47562","subject":"[PATCH] oidset: don't return value from oidset_init","startedAt":"2018-01-07T23:02:00Z","lastAt":"2018-01-09T07:33:22Z","messageCount":3,"participants":["Thomas Gummerer","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"336114","messageId":"20180107230404.23289-1-t.gummerer@gmail.com","threadId":"47562","inReplyTo":null,"subject":"[PATCH] oidset: don't return value from oidset_init","fromName":"Thomas Gummerer","fromEmail":"t.gummerer@gmail.com","sentAt":"2018-01-07T23:04:04Z","receivedAt":"2018-01-07T23:02:00Z","isPatch":true,"sender":{"key":"t.gummerer@gmail.com","avatar":"https://avatars.githubusercontent.com/u/191004?v=4"},"body":"c3a9ad3117 (\"oidset: add iterator methods to oidset\", 2017-11-21)\nintroduced a 'oidset_init()' function in oidset.h, which has void as\nreturn type, but returns an expression.\n\nThis makes the solaris compiler fail with:\n\n    \"oidset.h\", line 30: void function cannot return value\n\nAs the return type is void, and even the return type of the expression\nwe're trying to return (oidmap_init) is void just remove the return\nstatement to fix the compiler error.\n\nSigned-off-by: Thomas Gummerer <t.gummerer@gmail.com>\n---\n oidset.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/oidset.h b/oidset.h\nindex 783abceccd..40ec5f87fe 100644\n--- a/oidset.h\n+++ b/oidset.h\n@@ -27,7 +27,7 @@ struct oidset {\n \n static inline void oidset_init(struct oidset *set, size_t initial_size)\n {\n-\treturn oidmap_init(&set->map, initial_size);\n+\toidmap_init(&set->map, initial_size);\n }\n \n /**\n-- \n2.16.0.rc1.238.g530d649a79\n\n"},{"id":"336216","messageId":"xmqqincc6if3.fsf@gitster.mtv.corp.google.com","threadId":"47562","inReplyTo":"20180107230404.23289-1-t.gummerer@gmail.com","subject":"Re: [PATCH] oidset: don't return value from oidset_init","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-01-08T23:26:56Z","receivedAt":"2018-01-08T23:27:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thomas Gummerer <t.gummerer@gmail.com> writes:\n\n> c3a9ad3117 (\"oidset: add iterator methods to oidset\", 2017-11-21)\n> introduced a 'oidset_init()' function in oidset.h, which has void as\n> return type, but returns an expression.\n> ...\n> diff --git a/oidset.h b/oidset.h\n> index 783abceccd..40ec5f87fe 100644\n> --- a/oidset.h\n> +++ b/oidset.h\n> @@ -27,7 +27,7 @@ struct oidset {\n>  \n>  static inline void oidset_init(struct oidset *set, size_t initial_size)\n>  {\n> -\treturn oidmap_init(&set->map, initial_size);\n> +\toidmap_init(&set->map, initial_size);\n>  }\n\nMakes sense.  Perhaps \"inline\" hids this from error-checking\ncompilers, I wonder?\n\n"},{"id":"336224","messageId":"63acb4e5-4ebe-0fc3-a9ba-8141cceeee0c@kdbg.org","threadId":"47562","inReplyTo":"xmqqincc6if3.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] oidset: don't return value from oidset_init","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2018-01-09T07:33:13Z","receivedAt":"2018-01-09T07:33:22Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 09.01.2018 um 00:26 schrieb Junio C Hamano:\n> Thomas Gummerer <t.gummerer@gmail.com> writes:\n> \n>> c3a9ad3117 (\"oidset: add iterator methods to oidset\", 2017-11-21)\n>> introduced a 'oidset_init()' function in oidset.h, which has void as\n>> return type, but returns an expression.\n>> ...\n>> diff --git a/oidset.h b/oidset.h\n>> index 783abceccd..40ec5f87fe 100644\n>> --- a/oidset.h\n>> +++ b/oidset.h\n>> @@ -27,7 +27,7 @@ struct oidset {\n>>   \n>>   static inline void oidset_init(struct oidset *set, size_t initial_size)\n>>   {\n>> -\treturn oidmap_init(&set->map, initial_size);\n>> +\toidmap_init(&set->map, initial_size);\n>>   }\n> \n> Makes sense.  Perhaps \"inline\" hids this from error-checking\n> compilers, I wonder?\n\noutmap_init returns void itself. It is a modern language feature, I \nguess, that this void \"value\" can be forwarded in a return statement.\n\n-- Hannes\n"}]}