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

Re: [PATCH] http-push: workaround for format overflow warning in gcc >= 9

From
Junio C Hamano <gitster@pobox.com>
Date
May 13, 2019, 05:57 UTC
Message-ID
<xmqqa7fqdhgl.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAPig+cSY4SKXcppM6UYpeJ3z+PrUwiJ=whCmHQv4e_3CUZSwoQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 20 quoted lines
>>                 if (request->curl_result != CURLE_OK) {
>>                         fprintf(stderr, "Unable to get pack file %s\n%s",
>> -                               request->url, curl_errorstr);
>> +                               request->url ? request->url : "",
>> +                               curl_errorstr);
>>                 } else {
>
> If I'm reading the code correctly, the conditional and "true" branch
> of the ternary expression are dead code since 'request->url' will
> unconditionally be NULL due to the:
>
>     /* URL is reused for MOVE after PUT */
>     if (request->state != RUN_PUT) {
>         FREE_AND_NULL(request->url);
>     }
>
> earlier in the function. If you want to present a meaningful error
> message here, I could imagine squirreling-away the URL so it can be
> used in the error message, or re-working the code so that
> FREE_AND_NULL(request->url) is only done when and if needed.
That matches my understanding.
Previous: Eric Sunshine
Message 3 of 3 in “http-push: workaround for format overflow warning in gcc >= 9”
  1. http-push: workaround for format overflow warning in gcc >= 9Carlo Marcelo Arenas Belón, May 10, 2019
  2. Eric SunshineMay 10, 2019
  3. Junio C HamanoMay 13, 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.