git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 01/13] push: do not pretend to return `int` from `die_push_simple()`

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 4, 2019, 09:36 UTC
Message-ID
<nycvar.QRO.7.76.6.1910041136150.46@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqq36g9bgl6.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Fri, 4 Oct 2019, Junio C Hamano wrote:
Show 31 quoted lines
> "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com>
> writes:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > This function is marked as `NORETURN`, and it indeed does not want to
> > return anything. So let's not declare it with the return type `int`.
> > This fixes the following warning when building with MSVC:
> >
> > 	C4646: function declared with 'noreturn' has non-void return type
> >
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >  builtin/push.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/builtin/push.c b/builtin/push.c
> > index 021dd3b1e4..d216270d5f 100644
> > --- a/builtin/push.c
> > +++ b/builtin/push.c
> > @@ -143,8 +143,8 @@ static int push_url_of_remote(struct remote *remote, const char ***url_p)
> >  	return remote->url_nr;
> >  }
> >
> > -static NORETURN int die_push_simple(struct branch *branch,
> > -				    struct remote *remote)
> > +static NORETURN void die_push_simple(struct branch *branch,
> > +				     struct remote *remote)
>
> Haha ;-)  "I won't return and I'll return int" sounds like an
> oxymoron.
Funny, right? ;-)

I was a bit concerned that GCC did not catch it, nor Clang, but hey, that's the benefit of compiling with more than just one compiler.

Ciao, Dscho

Show 5 quoted lines
>
> >  {
> >  	/*
> >  	 * There's no point in using shorten_unambiguous_ref here,
>
Previous: Junio C HamanoNext: Johannes Schindelin via GitGitGadget
Message 24 of 72 in “ci: include a Visual Studio build & test in our Azure Pipeline”
  1. 00/13 ci: include a Visual Studio build & test in our Azure PipelineJohannes Schindelin via GitGitGadget, Sep 26, 2019
  2. 01/13 push: do not pretend to return `int` from `die_push_simple()`Johannes Schindelin via GitGitGadget, Sep 26, 2019
  3. 02/13 msvc: avoid using minus operator on unsigned typesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  4. Denton LiuSep 26, 2019
  5. Johannes SchindelinSep 26, 2019
  6. Denton LiuSep 26, 2019
  7. Johannes SchindelinSep 30, 2019
  8. 03/13 winansi: use FLEX_ARRAY to avoid compiler warningJohannes Schindelin via GitGitGadget, Sep 26, 2019
  9. 04/13 compat/win32/path-utils.h: add #include guardsJohannes Schindelin via GitGitGadget, Sep 26, 2019
  10. 05/13 msvc: ignore some libraries when linkingJohannes Schindelin via GitGitGadget, Sep 26, 2019
  11. 06/13 msvc: handle DEVELOPER=1Johannes Schindelin via GitGitGadget, Sep 26, 2019
  12. 07/13 msvc: work around a bug in GetEnvironmentVariable()Johannes Schindelin via GitGitGadget, Sep 26, 2019
  13. 08/13 vcxproj: only copy `git-remote-http.exe` once it was builtJohannes Schindelin via GitGitGadget, Sep 26, 2019
  14. 10/13 test-tool run-command: learn to run (parts of) the testsuiteJohannes Schindelin via GitGitGadget, Sep 26, 2019
  15. 09/13 vcxproj: include more generated filesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  16. 11/13 tests: let --immediate and --write-junit-xml play well togetherJohannes Schindelin via GitGitGadget, Sep 26, 2019
  17. Junio C HamanoSep 28, 2019
  18. Johannes SchindelinSep 30, 2019
  19. 12/13 ci: really use shallow clones on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  20. 13/13 ci: also build and test with MS Visual Studio on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 26, 2019
  21. 00/13 ci: include a Visual Studio build & test in our Azure PipelineJohannes Schindelin via GitGitGadget, Sep 30, 2019
  22. 01/13 push: do not pretend to return `int` from `die_push_simple()`Johannes Schindelin via GitGitGadget, Sep 30, 2019
  23. Junio C HamanoOct 3, 2019
  24. Johannes SchindelinOct 4, 2019
  25. 03/13 winansi: use FLEX_ARRAY to avoid compiler warningJohannes Schindelin via GitGitGadget, Sep 30, 2019
  26. 02/13 msvc: avoid using minus operator on unsigned typesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  27. Junio C HamanoOct 3, 2019
  28. Johannes SchindelinOct 4, 2019
  29. Johannes SixtOct 4, 2019
  30. Johannes SchindelinOct 4, 2019
  31. Junio C HamanoOct 6, 2019
  32. Johannes SixtOct 6, 2019
  33. Johannes SchindelinOct 8, 2019
  34. Johannes SixtOct 8, 2019
  35. 05/13 msvc: ignore some libraries when linkingJohannes Schindelin via GitGitGadget, Sep 30, 2019
  36. 06/13 msvc: handle DEVELOPER=1Johannes Schindelin via GitGitGadget, Sep 30, 2019
  37. 04/13 compat/win32/path-utils.h: add #include guardsJohannes Schindelin via GitGitGadget, Sep 30, 2019
  38. 07/13 msvc: work around a bug in GetEnvironmentVariable()Johannes Schindelin via GitGitGadget, Sep 30, 2019
  39. 11/13 tests: let --immediate and --write-junit-xml play well togetherJohannes Schindelin via GitGitGadget, Sep 30, 2019
  40. 13/13 ci: also build and test with MS Visual Studio on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  41. 10/13 test-tool run-command: learn to run (parts of) the testsuiteJohannes Schindelin via GitGitGadget, Sep 30, 2019
  42. 08/13 vcxproj: only copy `git-remote-http.exe` once it was builtJohannes Schindelin via GitGitGadget, Sep 30, 2019
  43. 09/13 vcxproj: include more generated filesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  44. 12/13 ci: really use shallow clones on Azure PipelinesJohannes Schindelin via GitGitGadget, Sep 30, 2019
  45. 00/13 ci: include a Visual Studio build & test in our Azure PipelineJohannes Schindelin via GitGitGadget, Oct 4, 2019
  46. 01/13 push: do not pretend to return `int` from `die_push_simple()`Johannes Schindelin via GitGitGadget, Oct 4, 2019
  47. 03/13 winansi: use FLEX_ARRAY to avoid compiler warningJohannes Schindelin via GitGitGadget, Oct 4, 2019
  48. Alban GruinOct 7, 2019
  49. 05/13 msvc: ignore some libraries when linkingJohannes Schindelin via GitGitGadget, Oct 4, 2019
  50. 02/13 msvc: avoid using minus operator on unsigned typesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  51. 08/13 vcxproj: only copy `git-remote-http.exe` once it was builtJohannes Schindelin via GitGitGadget, Oct 4, 2019
  52. 07/13 msvc: work around a bug in GetEnvironmentVariable()Johannes Schindelin via GitGitGadget, Oct 4, 2019
  53. 09/13 vcxproj: include more generated filesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  54. 04/13 compat/win32/path-utils.h: add #include guardsJohannes Schindelin via GitGitGadget, Oct 4, 2019
  55. 12/13 ci: really use shallow clones on Azure PipelinesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  56. 06/13 msvc: handle DEVELOPER=1Johannes Schindelin via GitGitGadget, Oct 4, 2019
  57. 11/13 tests: let --immediate and --write-junit-xml play well togetherJohannes Schindelin via GitGitGadget, Oct 4, 2019
  58. 10/13 test-tool run-command: learn to run (parts of) the testsuiteJohannes Schindelin via GitGitGadget, Oct 4, 2019
  59. 13/13 ci: also build and test with MS Visual Studio on Azure PipelinesJohannes Schindelin via GitGitGadget, Oct 4, 2019
  60. Junio C HamanoOct 6, 2019
  61. Johannes SchindelinOct 6, 2019
  62. Johannes SchindelinOct 6, 2019
  63. Junio C HamanoOct 7, 2019
  64. Johannes SchindelinOct 7, 2019
  65. Junio C HamanoOct 8, 2019
  66. Johannes SchindelinOct 8, 2019
  67. Philip OakleyOct 9, 2019
  68. Johannes SchindelinOct 10, 2019
  69. Philip OakleyOct 10, 2019
  70. Junio C HamanoOct 7, 2019
  71. Thomas GummererOct 7, 2019
  72. Johannes SchindelinOct 11, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.