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

Re: Compiler warning under cygwin/mingw

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 12, 2016, 23:20 UTC
Message-ID
<xmqqy48imn2e.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<1456754714-25237-1-git-send-email-szeder@ira.uka.de>
SZEDER Gábor <szeder@ira.uka.de> writes:
Show 21 quoted lines
> Hi,
>
>> > And MINGW is not happy for other reasons:
>> >
>> > builtin/rev-parse.c: In function 'cmd_rev_parse':
>> > builtin/rev-parse.c:775:12: warning: implicit declaration of function
>> > 'realpath' [-Wimplicit-function-declaration]
>> >        if (!realpath(gitdir, absolute_path))
>> >             ^
>> 
>> I guess you're building "pu"; that is only in sg/completion-updates. I
>> don't know if our custom real_path() would suffice there. You might want
>> to ping the author. The patch is:
>> 
>>   http://article.gmane.org/gmane.comp.version-control.git/287462
>
> Oh, I was not aware that there is a custom real_path() that is
> preferred over the system realpath().  I don't see why our real_path()
> would not suffice, it even makes the code a tad shorter.
>
> I will include the patch below in the reroll.

A friendly ping to see if I am missing new development that followed this message...

Show 28 quoted lines
>
> Best,
> Gábor
>
>
>  ----  >8  ----
> Subject: [PATCH] fixup! rev-parse: add '--absolute-git-dir' option
>
> ---
>  builtin/rev-parse.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
> index 90a4dd6032c0..d6d9a82c77c4 100644
> --- a/builtin/rev-parse.c
> +++ b/builtin/rev-parse.c
> @@ -762,10 +762,7 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix)
>  					if (!gitdir && !prefix)
>  						gitdir = ".git";
>  					if (gitdir) {
> -						char absolute_path[PATH_MAX];
> -						if (!realpath(gitdir, absolute_path))
> -							die_errno(_("unable to get absolute path"));
> -						puts(absolute_path);
> +						puts(real_path(gitdir));
>  						continue;
>  					}
>  				}
Previous: SZEDER GáborNext: Junio C Hamano
Message 8 of 18 in “50a6c8ef - xmalloc_array”
  1. Torsten BögershausenFeb 29, 2016
  2. compat/mingw: brown paper bag fix for 50a6c8eJeff King, Feb 29, 2016
  3. Torsten BögershausenFeb 29, 2016
  4. Jeff KingFeb 29, 2016
  5. Compiler warning under cygwin/mingw (was: fix for 50a6c8e)Torsten Bögershausen, Feb 29, 2016
  6. Jeff KingFeb 29, 2016
  7. SZEDER GáborFeb 29, 2016
  8. Junio C HamanoApr 12, 2016
  9. Junio C HamanoMay 10, 2016
  10. Ramsay JonesFeb 29, 2016
  11. Ramsay JonesMar 3, 2016
  12. Ramsay JonesMar 3, 2016
  13. Junio C HamanoFeb 29, 2016
  14. Jeff KingFeb 29, 2016
  15. Torsten BögershausenMar 1, 2016
  16. Jeff KingMar 1, 2016
  17. Johannes SchindelinMar 1, 2016
  18. Johannes SchindelinFeb 29, 2016

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.