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

Re: [PATCH v3] http: use xmalloc with cURL

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 15, 2019, 22:18 UTC
Message-ID
<xmqqblwq2hu2.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20190815214429.28048-1-carenas@gmail.com>
Carlo Marcelo Arenas Belón  <carenas@gmail.com> writes:
Show 6 quoted lines
>  #if LIBCURL_VERSION_NUM < 0x070800
>  #define curl_global_init(a) do { /* nothing */ } while (0)
> +#elif LIBCURL_VERSION_NUM >= 0x070c00
> +#define curl_global_init(a) curl_global_init_mem(a, xmalloc, free, \
> +						xrealloc, xstrdup, xcalloc)
>  #endif
Yup.  That looks better.

If your curl version is recent enough (which presumably is true for most people these days), the entire #if/#endif block is skipped while scanning for #else or #elif and #elseif willq be silently ignored; it is unfortunate that #elseif won't be flagged by CPP as a potential error X-<.

Previous: Carlo Marcelo Arenas Belón
Message 6 of 6 in “http: use xmalloc with cURL”
  1. http: use xmalloc with cURLCarlo Marcelo Arenas Belón, Aug 15, 2019
  2. Junio C HamanoAug 15, 2019
  3. http: use xmalloc with cURLCarlo Marcelo Arenas Belón, Aug 15, 2019
  4. Junio C HamanoAug 15, 2019
  5. http: use xmalloc with cURLCarlo Marcelo Arenas Belón, Aug 15, 2019
  6. Junio C HamanoAug 15, 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.