{"thread":{"id":"41580","subject":"[PATCH] Mark win32's pthread_exit() as NORETURN","startedAt":"2016-03-01T13:53:04Z","lastAt":"2016-03-02T20:33:15Z","messageCount":12,"participants":["Johannes Schindelin","Jeff King","stefan.naewe@atlas-elektronik.com","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"279953","messageId":"69eef72cfc77e62ad7ad17c6df5f2d2396c64991.1456840324.git.johannes.schindelin@gmx.de","threadId":"41580","inReplyTo":null,"subject":"[PATCH] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-01T13:53:04Z","receivedAt":"2016-03-01T13:53:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The pthread_exit() function is not expected to return. Ever.\n\nPointed out by Jeff King.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/win32/pthread.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\nindex 20b35a2..148db60 100644\n--- a/compat/win32/pthread.h\n+++ b/compat/win32/pthread.h\n@@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n extern pthread_t pthread_self(void);\n \n-static inline int pthread_exit(void *ret)\n+static inline int NORETURN pthread_exit(void *ret)\n {\n \tExitThread((DWORD)(intptr_t)ret);\n }\n-- \n2.7.2.windows.1.5.g64acc33\n"},{"id":"279954","messageId":"20160301135708.GA29303@sigill.intra.peff.net","threadId":"41580","inReplyTo":"69eef72cfc77e62ad7ad17c6df5f2d2396c64991.1456840324.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH] Mark win32's pthread_exit() as NORETURN","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-03-01T13:57:09Z","receivedAt":"2016-03-01T13:57:09Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 01, 2016 at 02:53:04PM +0100, Johannes Schindelin wrote:\n\n> The pthread_exit() function is not expected to return. Ever.\n> \n> Pointed out by Jeff King.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  compat/win32/pthread.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n> index 20b35a2..148db60 100644\n> --- a/compat/win32/pthread.h\n> +++ b/compat/win32/pthread.h\n> @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n>  #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n>  extern pthread_t pthread_self(void);\n>  \n> -static inline int pthread_exit(void *ret)\n> +static inline int NORETURN pthread_exit(void *ret)\n>  {\n>  \tExitThread((DWORD)(intptr_t)ret);\n>  }\n\nLooks obviously correct to me (I'll assume Windows isn't so crazy as to\nlet ExitThread ever return :) ).\n\n-Peff\n> -- \n> 2.7.2.windows.1.5.g64acc33\n"},{"id":"279955","messageId":"alpine.DEB.2.20.1603011511050.3152@virtualbox","threadId":"41580","inReplyTo":"20160301135708.GA29303@sigill.intra.peff.net","subject":"Re: [PATCH] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-01T14:11:50Z","receivedAt":"2016-03-01T14:11:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn Tue, 1 Mar 2016, Jeff King wrote:\n\n> On Tue, Mar 01, 2016 at 02:53:04PM +0100, Johannes Schindelin wrote:\n> \n> > The pthread_exit() function is not expected to return. Ever.\n> > \n> > Pointed out by Jeff King.\n> > \n> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> > ---\n> >  compat/win32/pthread.h | 2 +-\n> >  1 file changed, 1 insertion(+), 1 deletion(-)\n> > \n> > diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n> > index 20b35a2..148db60 100644\n> > --- a/compat/win32/pthread.h\n> > +++ b/compat/win32/pthread.h\n> > @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n> >  #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n> >  extern pthread_t pthread_self(void);\n> >  \n> > -static inline int pthread_exit(void *ret)\n> > +static inline int NORETURN pthread_exit(void *ret)\n> >  {\n> >  \tExitThread((DWORD)(intptr_t)ret);\n> >  }\n> \n> Looks obviously correct to me (I'll assume Windows isn't so crazy as to\n> let ExitThread ever return :) ).\n\nIndeed, you are correct in your implicit assumption that I should have\nclarified that in my commit message. I will amend the commit message.\n\nCiao,\nDscho\n"},{"id":"279956","messageId":"d584d8bdaa8645a406c96f2a11f04febf57b2c25.1456841593.git.johannes.schindelin@gmx.de","threadId":"41580","inReplyTo":"69eef72cfc77e62ad7ad17c6df5f2d2396c64991.1456840324.git.johannes.schindelin@gmx.de","subject":"[PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-01T14:13:49Z","receivedAt":"2016-03-01T14:13:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The pthread_exit() function is not expected to return. Ever. On Windows,\nwe call ExitThread() whose documentation claims: \"This function does not\nreturn a value.\":\n\n\thttps://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n\nPointed out by Jeff King.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tRelative to v1, only the commit message changed (to clarify that\n\tExitThread() indeed never returns).\n\n compat/win32/pthread.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\nindex 20b35a2..148db60 100644\n--- a/compat/win32/pthread.h\n+++ b/compat/win32/pthread.h\n@@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n extern pthread_t pthread_self(void);\n \n-static inline int pthread_exit(void *ret)\n+static inline int NORETURN pthread_exit(void *ret)\n {\n \tExitThread((DWORD)(intptr_t)ret);\n }\n-- \n2.7.2.windows.1.5.g64acc33\n"},{"id":"279968","messageId":"56D5A955.8010904@atlas-elektronik.com","threadId":"41580","inReplyTo":"d584d8bdaa8645a406c96f2a11f04febf57b2c25.1456841593.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"","fromEmail":"stefan.naewe@atlas-elektronik.com","sentAt":"2016-03-01T14:38:13Z","receivedAt":"2016-03-01T14:38:13Z","isPatch":true,"sender":{"key":"stefan.naewe@gmail.com","avatar":"https://avatars.githubusercontent.com/u/4468?v=4"},"body":"Am 01.03.2016 um 15:13 schrieb Johannes Schindelin:\n> The pthread_exit() function is not expected to return. Ever. On Windows,\n> we call ExitThread() whose documentation claims: \"This function does not\n> return a value.\":\n\nDoes this really mean that ExitThread() does not return ?\n\nJust wondering...\n\n>         https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n> \n> Pointed out by Jeff King.\n> \n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n> \n>         Relative to v1, only the commit message changed (to clarify that\n>         ExitThread() indeed never returns).\n> \n>  compat/win32/pthread.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n> index 20b35a2..148db60 100644\n> --- a/compat/win32/pthread.h\n> +++ b/compat/win32/pthread.h\n> @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n>  #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n>  extern pthread_t pthread_self(void);\n> \n> -static inline int pthread_exit(void *ret)\n> +static inline int NORETURN pthread_exit(void *ret)\n>  {\n>         ExitThread((DWORD)(intptr_t)ret);\n>  }\n> --\n\n\nStefan\n-- \n----------------------------------------------------------------\n/dev/random says: We're lost, but we're making good time.\npython -c \"print '73746566616e2e6e616577654061746c61732d656c656b74726f6e696b2e636f6d'.decode('hex')\" \nGPG Key fingerprint = 2DF5 E01B 09C3 7501 BCA9  9666 829B 49C5 9221 27AF\n"},{"id":"279988","messageId":"xmqq60x684j3.fsf@gitster.mtv.corp.google.com","threadId":"41580","inReplyTo":"56D5A955.8010904@atlas-elektronik.com","subject":"Re: [PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-01T17:57:36Z","receivedAt":"2016-03-01T17:57:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"<stefan.naewe@atlas-elektronik.com> writes:\n\n> Am 01.03.2016 um 15:13 schrieb Johannes Schindelin:\n>> The pthread_exit() function is not expected to return. Ever. On Windows,\n>> we call ExitThread() whose documentation claims: \"This function does not\n>> return a value.\":\n>\n> Does this really mean that ExitThread() does not return ?\n>\n> Just wondering...\n\n;-).\n\nThat made me re-read the patch and notice another thing... Dscho, I\nthink you would need s/int/void/, too, no?\n\n>\n>>         https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n>> \n>> Pointed out by Jeff King.\n>> \n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> ---\n>> \n>>         Relative to v1, only the commit message changed (to clarify that\n>>         ExitThread() indeed never returns).\n>> \n>>  compat/win32/pthread.h | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>> \n>> diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n>> index 20b35a2..148db60 100644\n>> --- a/compat/win32/pthread.h\n>> +++ b/compat/win32/pthread.h\n>> @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n>>  #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n>>  extern pthread_t pthread_self(void);\n>> \n>> -static inline int pthread_exit(void *ret)\n>> +static inline int NORETURN pthread_exit(void *ret)\n>>  {\n>>         ExitThread((DWORD)(intptr_t)ret);\n>>  }\n>> --\n>\n>\n> Stefan\n"},{"id":"279997","messageId":"56D5EEE2.3080100@kdbg.org","threadId":"41580","inReplyTo":"d584d8bdaa8645a406c96f2a11f04febf57b2c25.1456841593.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-03-01T19:34:58Z","receivedAt":"2016-03-01T19:34:58Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 01.03.2016 um 15:13 schrieb Johannes Schindelin:\n> The pthread_exit() function is not expected to return. Ever. On Windows,\n> we call ExitThread() whose documentation claims: \"This function does not\n> return a value.\":\n>\n> \thttps://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n\nThis is misleading: MSDN marks all functions declared void as \"does not \nreturn a value,\" for example, look at EnterCriticalSection:\n\nhttps://msdn.microsoft.com/en-us/library/windows/desktop/ms682608\n\nFor this reason, I actually prefer your version 1 patch without the \nexplanation.\n\n>\n> Pointed out by Jeff King.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>\n> \tRelative to v1, only the commit message changed (to clarify that\n> \tExitThread() indeed never returns).\n>\n>   compat/win32/pthread.h | 2 +-\n>   1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n> index 20b35a2..148db60 100644\n> --- a/compat/win32/pthread.h\n> +++ b/compat/win32/pthread.h\n> @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n>   #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n>   extern pthread_t pthread_self(void);\n>\n> -static inline int pthread_exit(void *ret)\n> +static inline int NORETURN pthread_exit(void *ret)\n\nI would have written it as\n\n#ifdef __GNUC__\n__attribute__((__noreturn__))\n#endif\nstatic inline int pthread_exit(void *ret) ...\n\nbut I can live with your version as long as it compiles.\n\nYour solution is pragmatic: NORETURN is defined in git-compat-util.h, \nand by using it here, we depend on that pthread.h is included \nsufficiently late that the macro is available at this point. The \ninstance in compat/nedmalloc/malloc.c.h is bracketed with #ifndef WIN32 \nso that it is not compiled on Windows, all other instances are after \ngit-compat-util.h or cache.h or in headers that are to be included only \nafter git-compat-util.h or cache.h per convention. Looks like we are safe.\n\n>   {\n>   \tExitThread((DWORD)(intptr_t)ret);\n>   }\n>\n"},{"id":"279998","messageId":"xmqqio166l0n.fsf@gitster.mtv.corp.google.com","threadId":"41580","inReplyTo":"56D5EEE2.3080100@kdbg.org","subject":"Re: [PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-01T19:44:24Z","receivedAt":"2016-03-01T19:44:24Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 01.03.2016 um 15:13 schrieb Johannes Schindelin:\n>> The pthread_exit() function is not expected to return. Ever. On Windows,\n>> we call ExitThread() whose documentation claims: \"This function does not\n>> return a value.\":\n>>\n>> \thttps://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n>\n> This is misleading: MSDN marks all functions declared void as \"does\n> not return a value,\" for example, look at EnterCriticalSection:\n>\n> https://msdn.microsoft.com/en-us/library/windows/desktop/ms682608\n>\n> For this reason, I actually prefer your version 1 patch without the\n> explanation.\n\n;-)\n\n>> -static inline int pthread_exit(void *ret)\n>> +static inline int NORETURN pthread_exit(void *ret)\n>\n> I would have written it as\n>\n> #ifdef __GNUC__\n> __attribute__((__noreturn__))\n> #endif\n> static inline int pthread_exit(void *ret) ...\n>\n> but I can live with your version as long as it compiles.\n\nEither way, let's make sure that the final version returns \"void\",\ncf.\n\nhttp://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html\n\nThanks.\n"},{"id":"280084","messageId":"alpine.DEB.2.20.1603022008240.3152@virtualbox","threadId":"41580","inReplyTo":"xmqqio166l0n.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-02T19:10:29Z","receivedAt":"2016-03-02T19:10:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 1 Mar 2016, Junio C Hamano wrote:\n\n> Johannes Sixt <j6t@kdbg.org> writes:\n> \n> > Am 01.03.2016 um 15:13 schrieb Johannes Schindelin:\n> >> The pthread_exit() function is not expected to return. Ever. On Windows,\n> >> we call ExitThread() whose documentation claims: \"This function does not\n> >> return a value.\":\n> >>\n> >> \thttps://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n> >\n> > This is misleading: MSDN marks all functions declared void as \"does\n> > not return a value,\" for example, look at EnterCriticalSection:\n> >\n> > https://msdn.microsoft.com/en-us/library/windows/desktop/ms682608\n> >\n> > For this reason, I actually prefer your version 1 patch without the\n> > explanation.\n> \n> ;-)\n\nWell, I really like to have that link so I can find it very easily myself\nby simply inspecting the Git log. And the explanation itself was easily\nfixed.\n\n> \n> >> -static inline int pthread_exit(void *ret)\n> >> +static inline int NORETURN pthread_exit(void *ret)\n> >\n> > I would have written it as\n> >\n> > #ifdef __GNUC__\n> > __attribute__((__noreturn__))\n> > #endif\n> > static inline int pthread_exit(void *ret) ...\n> >\n> > but I can live with your version as long as it compiles.\n> \n> Either way, let's make sure that the final version returns \"void\",\n> cf.\n> \n> http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html\n\nFixed, too, in the upcoming v3.\n\nCiao,\nDscho\n"},{"id":"280085","messageId":"alpine.DEB.2.20.1603022010410.3152@virtualbox","threadId":"41580","inReplyTo":"56D5A955.8010904@atlas-elektronik.com","subject":"Re: [PATCH v2] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-02T19:11:00Z","receivedAt":"2016-03-02T19:11:00Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 1 Mar 2016, stefan.naewe@atlas-elektronik.com wrote:\n\n> Am 01.03.2016 um 15:13 schrieb Johannes Schindelin:\n> > The pthread_exit() function is not expected to return. Ever. On Windows,\n> > we call ExitThread() whose documentation claims: \"This function does not\n> > return a value.\":\n> \n> Does this really mean that ExitThread() does not return ?\n\nI fixed the commit message in v3.\n\nThanks,\nDscho\n"},{"id":"280086","messageId":"63310f6af16c70870bd620c83d8860421ca02718.1456945703.git.johannes.schindelin@gmx.de","threadId":"41580","inReplyTo":"d584d8bdaa8645a406c96f2a11f04febf57b2c25.1456841593.git.johannes.schindelin@gmx.de","subject":"[PATCH v3] Mark win32's pthread_exit() as NORETURN","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2016-03-02T19:11:13Z","receivedAt":"2016-03-02T19:11:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The pthread_exit() function is not expected to return. Ever. On Windows,\nwe call ExitThread() whose documentation claims: \"Ends the calling\nthread\", i.e. there is no condition in which this function simply\nreturns: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n\nWhile at it, fix the return type to be void, as per\nhttp://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html\n\nPointed out by Jeff King, helped by Stefan Naewe, Junio Hamano &\nJohannes Sixt.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n compat/win32/pthread.h | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\nInterdiff vs v2:\n\n diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n index 148db60..b6ed9e7 100644\n --- a/compat/win32/pthread.h\n +++ b/compat/win32/pthread.h\n @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n  #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n  extern pthread_t pthread_self(void);\n  \n -static inline int NORETURN pthread_exit(void *ret)\n +static inline void NORETURN pthread_exit(void *ret)\n  {\n  \tExitThread((DWORD)(intptr_t)ret);\n  }\n\n\ndiff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\nindex 20b35a2..b6ed9e7 100644\n--- a/compat/win32/pthread.h\n+++ b/compat/win32/pthread.h\n@@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n extern pthread_t pthread_self(void);\n \n-static inline int pthread_exit(void *ret)\n+static inline void NORETURN pthread_exit(void *ret)\n {\n \tExitThread((DWORD)(intptr_t)ret);\n }\n-- \n2.7.2.windows.1.5.g64acc33\n"},{"id":"280092","messageId":"xmqq7fhk4o38.fsf@gitster.mtv.corp.google.com","threadId":"41580","inReplyTo":"63310f6af16c70870bd620c83d8860421ca02718.1456945703.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v3] Mark win32's pthread_exit() as NORETURN","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-03-02T20:33:15Z","receivedAt":"2016-03-02T20:33:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> The pthread_exit() function is not expected to return. Ever. On Windows,\n> we call ExitThread() whose documentation claims: \"Ends the calling\n> thread\", i.e. there is no condition in which this function simply\n> returns: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682659\n>\n> While at it, fix the return type to be void, as per\n> http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_exit.html\n>\n> Pointed out by Jeff King, helped by Stefan Naewe, Junio Hamano &\n> Johannes Sixt.\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n\nThanks, will queue.\n\n>  compat/win32/pthread.h | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> Interdiff vs v2:\n>\n>  diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n>  index 148db60..b6ed9e7 100644\n>  --- a/compat/win32/pthread.h\n>  +++ b/compat/win32/pthread.h\n>  @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n>   #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n>   extern pthread_t pthread_self(void);\n>   \n>  -static inline int NORETURN pthread_exit(void *ret)\n>  +static inline void NORETURN pthread_exit(void *ret)\n>   {\n>   \tExitThread((DWORD)(intptr_t)ret);\n>   }\n>\n>\n> diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h\n> index 20b35a2..b6ed9e7 100644\n> --- a/compat/win32/pthread.h\n> +++ b/compat/win32/pthread.h\n> @@ -78,7 +78,7 @@ extern int win32_pthread_join(pthread_t *thread, void **value_ptr);\n>  #define pthread_equal(t1, t2) ((t1).tid == (t2).tid)\n>  extern pthread_t pthread_self(void);\n>  \n> -static inline int pthread_exit(void *ret)\n> +static inline void NORETURN pthread_exit(void *ret)\n>  {\n>  \tExitThread((DWORD)(intptr_t)ret);\n>  }\n"}]}